Last modified: 2014-08-30 15:29:10 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 T67597, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65597 - i18n files can generate extremely un-helpful exceptions
i18n files can generate extremely un-helpful exceptions
Status: RESOLVED DUPLICATE of bug 65105
Product: MediaWiki
Classification: Unclassified
Internationalization (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-21 19:29 UTC by Mark A. Hershberger
Modified: 2014-08-30 15:29 UTC (History)
9 users (show)

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


Attachments

Description Mark A. Hershberger 2014-05-21 19:29:55 UTC
The following JSON in an i18n file produces the error "Fatal exception of type MWException":

 {
        "authors": ['']
 }

Nothing else is output.

Hidden away in the source is the message to add "$wgShowExceptionDetails = true" for more details -- it seems like that should be more prominent for idiots like me.

Adding it gives the following trace:
 Exception from line 562 of includes/cache/LocalisationCache.php: LocalisationCache::readJSONFile:
    Invalid JSON file: extensions/Presentation/i18n/en.json<

 Backtrace:

 #0 includes/cache/LocalisationCache.php(866): LocalisationCache->readJSONFile(string)
 #1 includes/cache/LocalisationCache.php(452): LocalisationCache->recache(string)
 #2 includes/cache/LocalisationCache.php(326): LocalisationCache->initLanguage(string)
 #3 includes/cache/LocalisationCache.php(363): LocalisationCache->loadItem(string, string)
 #4 includes/cache/LocalisationCache.php(283): LocalisationCache->loadSubitem(string, string, string)
 #5 languages/Language.php(3020): LocalisationCache->getSubitem(string, string, string)
 #6 includes/MagicWord.php(314): Language->getMagic(MagicWord)
 #7 includes/MagicWord.php(241): MagicWord->load(string)
 #8 includes/content/WikitextContent.php(186): MagicWord::get(string)
 #9 includes/content/AbstractContent.php(308):  WikitextContent->getRedirectTarget()
 #10 includes/WikiPage.php(498): AbstractContent->isRedirect()
 #11 [internal function]: WikiPage->isRedirect()
 #12 includes/Article.php(2024): call_user_func_array(array, array)
 #13 includes/Wiki.php(362): Article->__call(string, array)
 #14 includes/Wiki.php(362): Article->isRedirect()
 #15 includes/Wiki.php(289): MediaWiki->initializeArticle()
 #16 includes/Wiki.php(588): MediaWiki->performRequest()
 #17 includes/Wiki.php(447): MediaWiki->main()
 #18 index.php(46): MediaWiki->run()
 #19 {main}
Comment 1 Niklas Laxström 2014-05-22 19:49:54 UTC
I can't fathom why would we get the file contents as an exception message.
Comment 2 Mark A. Hershberger 2014-05-22 20:28:07 UTC
(In reply to Niklas Laxström from comment #1)
> I can't fathom why would we get the file contents as an exception message.

I don't think you need to do that.  The exception, though, should point to the file.  Given when this exception occurs, the message isn't going to be seen by anyone but the developer.  Saying "Invalid JSON file: extensions/Presentation/i18n/en.json" would be better than the current "Fatal exception of type MWException".
Comment 3 Nemo 2014-08-30 15:29:10 UTC
Was already reported by a certain person you know. :)

*** This bug has been marked as a duplicate of bug 65105 ***

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


Navigation
Links