MediaWiki r51128 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r51127‎ | r51128 (on ViewVC)‎ | r51129 >
Date:18:13, 28 May 2009
Author:shinjiman
Status:reverted (Comments)
Tags:
Comment:
* (bug 18958) Added ability to disable entire variant conversion engine per user preferences (languages with language converter class only)
Modified paths:

Diff [purge]

Loading diff…

Follow-up revisions

Rev.Commit summaryAuthorDate
r51129follow up r51128, reverting special page aliases which was accidentally commi...shinjiman18:22, 28 May 2009
r51130follow up r51128, update more of RELEASE-NOTESshinjiman18:31, 28 May 2009
r51390follow up r51128, adding type check for $wgUser->getOption( 'variantconversio...shinjiman08:16, 3 June 2009
r51460Revert r51128, and its follow-up revisions r51129, r51130, r51390....werdna09:48, 4 June 2009

Comments

#Comment by Tim Starling (talk | contribs)   07:34, 3 June 2009

It's so totally broken that I can only assume it's untested. There's no default defined for the variantconversion user preference, so the default comes out of $wgUser->getOption() as null. LanguageConverter::parserConvert() then tests if null == 0, which it is, and so it sets $wgEnableVariants = false. This makes the variant links disappear from the tab list, and the variant preferences disappear from the Special:Preferences. $extraUserToggles doesn't appear to actually do anything in the new preferences system, so there's no way to turn the variant tabs back on. But they will come back on a parser cache hit, since LanguageConverter::parserConvert() is not called in that case and so $wgEnableVariants is true.

I was looking for parser cache pollution, which I'm quite sure is possible, but I couldn't get that far because the feature doesn't work at all.

Please revert these changes and anything else that is related. In the future, please test your code thoroughly before you commit it.

#Comment by Shinjiman (talk | contribs)   08:20, 3 June 2009

The type check had been added in r51390.

The $extraUserToggles variable on Special:Preferences is currently blocked by the bug 18870.

#Comment by Werdna (talk | contribs)   09:20, 4 June 2009

You missed the point, which was that you have to add a default for every preference, and that preference should default to true. Hacking in a special-case for "no preference" isn't the correct solution.

Seems to also include an unrelated change of name for a configuration variable. Don't do this, and if you do, include backwards-compatibility code.


#Comment by Werdna (talk | contribs)   09:50, 4 June 2009

Reverted in r51460.

Status & tagging log

  • 09:50, 4 June 2009 Werdna (talk | contribs) changed the status of r51128 [removed: fixme added: reverted]
  • 07:34, 3 June 2009 Tim Starling (talk | contribs) changed the status of r51128 [removed: new added: fixme]