Page MenuHomePhabricator

Babel: strange page title on preview or after saving (behaving as if it were a category)
Closed, ResolvedPublic

Description

Screenshot of "Portal:Rup" on Translatewiki: displaying a page title as if it were a category

When previewing an edit or after saving a page that uses the {{#babel}} parser function, the page thinks it is a category and displays the page title (and content depending on the page title) as if it were the category of the last language in {{#babel}}.
For example, a page with {{#babel:nl|en-3|fr-2}} would make the page behave like "Category:Fr-2" (depending on the configuration for categories).

When refreshing the page, it is normal again.

(I actually wonder why nobody reported this yet, or is it a new bug?)


Version: unspecified
Severity: normal

Attached:

Details

Reference
bz29245

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:37 PM
bzimport set Reference to bz29245.
SPQRobin created this task.Jun 2 2011, 1:56 PM

Cannot reproduce on preview.

It's strange, sometimes it does this and sometimes not...

Let us know if you are able to reproduce this reliably

Created attachment 8727
Screenshot before and after doing a null edit

See screenshot. I went to http://www.omegawiki.org/Help:Babel and it displayed as above (as a category). Then I did a null edit (didn't change anything actually) and saved the page so it parsed the page again, and it displayed properly.

So apparently it's not only on page preview or page edit, but also when just visiting a page.

Does no-one else encounter this strange bug?

Attached:

And there was also a strange text UNIQb002b8242bbcc42-pre-00000000-QINU instead of the <pre> stuff.

Seems to be caused [on my local test wiki] only during requests in which a category is auto-created (At least on my local install).

This type of error is usually caused by calling the parser recursively, sometimes via wfMsg calls.

Steps to reproduce
*Add {{#babel:eng}} to a page
*Delete category:en
*purge the first page, issue appears. You can make issue re-appear by deleting the category.

Specifically, its caused by the Article::prepareTextForEdit (when it does $wgParser->parse) which is called by Article::doEdit which is called by the BabelAutoCreate::create.

There's not really much way to get around that. Perhaps the autocreate code could be run as a deferred update ($wgDeferredUpdateList) instead.

Fixed (albeit not in the prettiest way) in r97084