Last modified: 2014-02-04 17:12:35 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T58911, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56911 - PHP Warning: strtr(): The second argument is not an array in includes/utils/StringUtils.php
PHP Warning: strtr(): The second argument is not an array in includes/utils/...
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
All All
: High major (vote)
: 1.22.0 release
Assigned To: Niklas Laxström
Depends on:
  Show dependency treegraph
Reported: 2013-11-11 18:35 UTC by Niklas Laxström
Modified: 2014-02-04 17:12 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Niklas Laxström 2013-11-11 18:35:27 UTC
For some reason language converter is breaking stuff on some pages and flooding our logs considerably. Cannot debug properly since this only happens in production.

Cause is likely between 9ef2bf0 and b32d16d in core, or it might be in extensions as well.

#0 /www/ ReplacementArray->replace('?Saqlangan sahi...')
#1 /www/ LanguageConverter->translate('?Saqlangan sahi...', 'uz')
#2 /www/ LanguageConverter->autoConvert('<p>Saqlangan sa...', 'uz')
#3 /www/ LanguageConverter->recursiveConvertTopLevel('<p>Saqlangan sa...', 'uz')
#4 /www/ LanguageConverter->convertTo('<p>Saqlangan sa...', 'uz')
#5 /www/ LanguageConverter->convert('<p>Saqlangan sa...')
#6 /www/ Language->convert('<p>Saqlangan sa...')
#7 [internal function]: Parser->parse('Saqlangan sahif...', Object(Title), Object(ParserOptions), true, true, 4373942)
#8 /www/ call_user_func_array(Array, Array)
#9 /www/ StubObject->_call('parse', Array)
#10 /www/ StubObject->__call('parse', Array)
#11 /www/ StubObject->parse('Saqlangan sahif...', Object(Title), Object(ParserOptions), true, true, 4373942)
#12 /www/ WikitextContent->getParserOutput(Object(Title), 4373942, Object(ParserOptions))
#13 /www/ PoolWorkArticleView->doWork()
#14 /www/ PoolCounterWork->execute()
#15 /www/ Article->view()
#16 /www/ ViewAction->show()
#17 /www/ MediaWiki->performAction(Object(Article), Object(Title))
#18 /www/ MediaWiki->performRequest()
#19 /www/ MediaWiki->main()
#20 /www/ MediaWiki->run()
#21 {main}
[11-Nov-2013 18:19:34 UTC] PHP Warning:  strtr(): The second argument is not an array in /www/ on line 509
Comment 1 Niklas Laxström 2013-11-11 18:51:45 UTC
$wgDisableLangConversion = true; doesn't help. It does hide the language conversion tabs though (which I haven't seen before).
Comment 2 Niklas Laxström 2013-11-11 19:16:17 UTC
On my development wiki:
object(ReplacementArray)#428 (2) {
  array(0) {

On production:
object(ReplacementArray)#330 (3) {
  array(0) {

When dumping the conversion table in LanguageConverter.php(468). No idea how can there be two keys with "data".
Comment 3 Gerrit Notification Bot 2013-11-11 19:41:14 UTC
Change 94789 had a related patch set uploaded by Nikerabbit:
Increase LanguageConverter cache version
Comment 4 Gerrit Notification Bot 2013-11-11 19:51:12 UTC
Change 94789 merged by jenkins-bot:
Increase LanguageConverter cache version
Comment 5 db [inactive,noenotif] 2014-01-11 21:20:28 UTC
Issue was only the wrong version inside the cache and now fixed by invalide the cache?
Comment 6 Kevin Israel (PleaseStand) 2014-02-04 17:07:08 UTC
(In reply to comment #5)
> Issue was only the wrong version inside the cache and now fixed by invalide
> the
> cache?

Yes. The PHP interpreter, and thus the PHP serialize() format, encodes a property's visibility as a property name prefix:

* "" (no prefix) for public properties
* "\0*\0" for protected properties
* "\0$class\0" for private properties

Consequently, when an old ReplacementArray is unserialized, the property's (un)prefixed name does not match, and thus its value is not properly set. Bumping the cache version prevents this from happening.

Note You need to log in before you can comment on or make changes to this bug.