Page MenuHomePhabricator

Redirect preview rendering stops prematurely, hides categories
Closed, ResolvedPublic

Description

If I make a redirect, like the following:

#REDIRECT [[Sophie Cabra]]
[[Category:Elephant characters]]

and then click preview, the category bar is not shown at the bottom of the preview.

Conversely, if I write the following:

[[Category:Elephant characters]]
#REDIRECT [[Sophie Cabra]]

the category bar is shown in the prieview.

If I save the page and view the redirect page, the category bar is shown in either case.

It seems like processing of the preview ends at the redirect. This gives a misleading view of the categories that the redirect will be in, and may mislead people into thinking that a redirect cannot be in a category. If the order does not matter in the saved page, it should not matter in the preview either.


Version: unspecified
Severity: trivial

Details

Reference
bz18775

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:37 PM
bzimport set Reference to bz18775.
bzimport added a subscriber: Unknown Object (MLST).

Created attachment 9955
Patch to fix the bug

Just noticed this bug, hard to believe it's been around so long and no one fixed it.

The fix is simple: we have to run the text through the parser and give the parser output to $wgOut->addParserOutputNoText() in order to get the template links, categories, and such updated.

The attached patch is mostly fixing the indentation after moving most of the junk in the "else" branch to outside of the if.

Attached: