Page MenuHomePhabricator

Investigate Special:Undelete state
Closed, ResolvedPublic


The Special:Undelete page seems to be having several issues including:

  • reference section not visible (T259541)
  • edit links visible although not expected to be there (T228147)
  • "termbox" section is showing some "odd" string (T261511)

See e.g. on

Expected outcome: Rootcause determined, check if the shared reasons, and update the related bug report tickets accordingly

Relevant MediaWiki rights:

  • Delete and undelete specific revisions of pages (deleterevision)
  • Delete pages (delete)
  • Undelete a page (undelete)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

TL;DR teach OutputPageBeforeHTMLHookHandler::onOutputPageBeforeHTML and OutputPageEntityIdReader::getEntityIdFromOutputPage about Special:Undelete and things should work.

The three problems (edit links, references, termbox placeholder) mentioned in the description indeed appear to share the same root cause. The issue is that OutputPageBeforeHTMLHookHandler and some related code are not running on Special:Undelete because it's not an entity "article" page.

The first bit of code that needs fixing is the guard in OutputPageBeforeHTMLHookHandler::onOutputPageBeforeHTML which checks for isArticle which is false for Special:Undelete. Removing this line unlocks the hidden edit links, but leaves references and termbox placeholder string still broken.

The second problem lies in OutputPageEntityIdReader::getEntityIdFromOutputPage which is another guard against non-entity pages. By removing this check as well, the page looks as it's supposed to.

It looks like these two pieces of code actually want to check the same thing. Maybe they could even share code.