Page MenuHomePhabricator

[regression] [[mediawiki:sidebar]] no longer supports entirely numeric headers ("* 3829")
Closed, ResolvedPublic

Description

[regression] [[mediawiki:sidebar]] no longer supports entirely numeric headers ("* 3829")

don't have to be logged in to see the error. stack (below) varies depending on the skin in use. (broken with both monobook and vector)

probably broke sometime between 2014-08-10 (last revision before it was noticed broken @ wikimaniateam) and 2014-10-03.

lego says the bug is in Skin::addToSidebarPlain

see also https://stackoverflow.com/questions/4100488/a-numeric-string-as-array-key-in-php

Unexpected non-MediaWiki exception encountered, of type "InvalidArgumentException"
[16b391a6] /wiki/Main_Page?useskin=monobook Exception from line 240 of /srv/mediawiki/php-1.25wmf2/includes/Message.php: $key must be a string or an array
Backtrace:
#0 /srv/mediawiki/php-1.25wmf2/includes/GlobalFunctions.php(1424): Message->__construct(integer, array)
#1 /srv/mediawiki/php-1.25wmf2/skins/MonoBook/MonoBookTemplate.php(352): wfMessage(integer)
#2 /srv/mediawiki/php-1.25wmf2/skins/MonoBook/MonoBookTemplate.php(220): MonoBookTemplate->customBox(integer, array)
#3 /srv/mediawiki/php-1.25wmf2/skins/MonoBook/MonoBookTemplate.php(136): MonoBookTemplate->renderPortals(array)
#4 /srv/mediawiki/php-1.25wmf2/includes/skins/SkinTemplate.php(242): MonoBookTemplate->execute()
#5 /srv/mediawiki/php-1.25wmf2/includes/OutputPage.php(2186): SkinTemplate->outputPage()
#6 /srv/mediawiki/php-1.25wmf2/includes/MediaWiki.php(594): OutputPage->output()
#7 /srv/mediawiki/php-1.25wmf2/includes/MediaWiki.php(435): MediaWiki->main()
#8 /srv/mediawiki/php-1.25wmf2/index.php(46): MediaWiki->run()
#9 /srv/mediawiki/w/index.php(3): include(string)
#10 {main}

Details

Reference
bz71639
Related Gerrit Patches:
mediawiki/skins/MonoBook : REL1_24Allow numeric headers in Sidebar
mediawiki/skins/CologneBlue : REL1_24Allow numeric headers in Sidebar
mediawiki/skins/Vector : REL1_24Allow numeric headers in Sidebar
mediawiki/skins/CologneBlue : masterAllow numeric headers in Sidebar
mediawiki/skins/MonoBook : masterAllow numeric headers in Sidebar
mediawiki/skins/Vector : masterAllow numeric headers in Sidebar

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:44 AM
bzimport set Reference to bz71639.
bzimport added a subscriber: Unknown Object (MLST).
jeremyb created this task.Oct 4 2014, 5:57 AM

Most likely caused by I458c0af3114754ddf3d721f6c374e249f482e4cf.

The bug is that if you set a string which is also an integer to the key of an array, PHP will cast it to an int, and then we try passing it to wfMessage, which throws an error. In MonoBookTemplate::customBox we should cast the keys to strings before passing to wfMessage.

Setting milestone to 1.24.0 release.

Krenair added a subscriber: Krenair.

Change 184151 had a related patch set uploaded (by Umherirrender):
Allow numeric headers in Sidebar

https://gerrit.wikimedia.org/r/184151

Patch-For-Review

Change 184152 had a related patch set uploaded (by Umherirrender):
Allow numeric headers in Sidebar

https://gerrit.wikimedia.org/r/184152

Patch-For-Review

Change 184153 had a related patch set uploaded (by Umherirrender):
Allow numeric headers in Sidebar

https://gerrit.wikimedia.org/r/184153

Patch-For-Review

Umherirrender added a subscriber: Umherirrender.

Modern skin will be fixed, when Monobook gets fixed, because the sidebar code gets inheritance.

Than all skins on wmf wiki will be safe, other skins in gerrit are not checked.

Change 184151 merged by jenkins-bot:
Allow numeric headers in Sidebar

https://gerrit.wikimedia.org/r/184151

Change 184152 merged by jenkins-bot:
Allow numeric headers in Sidebar

https://gerrit.wikimedia.org/r/184152

Change 184153 merged by jenkins-bot:
Allow numeric headers in Sidebar

https://gerrit.wikimedia.org/r/184153

matmarex updated the task description. (Show Details)
matmarex removed a project: Patch-For-Review.
matmarex set Security to None.
matmarex removed a subscriber: Unknown Object (MLST).
matmarex closed this task as Resolved.Jan 11 2015, 1:28 PM

So that should be fixed now. Do we want to backport the fixes?

I would backport the changes, because https://gerrit.wikimedia.org/r/#/c/126936/ is part of REL1_24 and may gives bad impact when updating.

matmarex reopened this task as Open.Jan 11 2015, 4:06 PM
matmarex removed a subscriber: matmarex.

Change 184390 had a related patch set uploaded (by Legoktm):
Allow numeric headers in Sidebar

https://gerrit.wikimedia.org/r/184390

Patch-For-Review

Change 184391 had a related patch set uploaded (by Legoktm):
Allow numeric headers in Sidebar

https://gerrit.wikimedia.org/r/184391

Patch-For-Review

Change 184392 had a related patch set uploaded (by Legoktm):
Allow numeric headers in Sidebar

https://gerrit.wikimedia.org/r/184392

Patch-For-Review

Change 184390 merged by jenkins-bot:
Allow numeric headers in Sidebar

https://gerrit.wikimedia.org/r/184390

Change 184392 merged by jenkins-bot:
Allow numeric headers in Sidebar

https://gerrit.wikimedia.org/r/184392

Change 184391 merged by jenkins-bot:
Allow numeric headers in Sidebar

https://gerrit.wikimedia.org/r/184391

Legoktm closed this task as Resolved.Jan 12 2015, 6:42 PM

Backported to 1.24 branches.