Page MenuHomePhabricator

Babel boxes in editnotices display unparsed wikitext
Open, LowPublic

Description

I have a babelbox at https://commons.wikimedia.org/wiki/User:Multichill
"{{#babel:nl|en-3|de-1|fr-1||||||}}". That works.

I also have an edit notice at https://commons.wikimedia.org/wiki/User_talk:Multichill/Editnotice .
It has the same babelbox and if you look at it as a normal page, it works.

When you open https://commons.wikimedia.org/w/index.php?title=User_talk:Multichill&action=edit you'll see the edit notice and there German is broken:
"{{GENDER:Multichill|Dieser Benutzer|Diese Benutzerin|Dieser Benutzer}}"

The last change was https://commons.wikimedia.org/w/index.php?title=User_talk%3AMultichill%2FEditnotice&diff=62294236&oldid=48213249 (2011) and the message https://translatewiki.net/w/i.php?title=MediaWiki%3ABabel-1%2Fde&diff=2089162&oldid=536844 (2010) and I'm pretty sure it worked the last years, I just noticed it today.


Version: unspecified
Severity: normal

Details

Reference
bz54347

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:02 AM
bzimport set Reference to bz54347.
bzimport added a subscriber: Unknown Object (MLST).

Ehr... Pretty weird. No idea off the top of my head why this is happening.

TTO subscribed.

This occurs because the editnotice is a system message, which is parsed using MessageCache::singleton()->parse(). While parsing the editnotice, the babel box is encountered, causing the babel messages like "This user has a native understanding of English" to be parsed using wfMessage, which calls MessageCache::singleton()->transform(). But the message cache singleton is already in parsing mode (from the editnotice system message), so it simply returns the text of the babel message without parsing.

The fact that MessageCache uses global state like this suggests that this is a deep-seated architectural issue with the PHP parser, and I don't think we can do a whole lot about it other than anticipate the coming of a new parsing service.

I haven't looked back in the git history to see if this worked correctly under old MW versions, as Multichill suspected.

TTO renamed this task from {{GENDER}} stopped working in editnotice to Babel boxes in editnotices display unparsed wikitext.Jan 28 2016, 12:41 PM
TTO lowered the priority of this task from Medium to Low.
TTO set Security to None.
TTO removed a subscriber: wikibugs-l-list.