Last modified: 2014-08-30 15:29:10 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}
I can't fathom why would we get the file contents as an exception message.
(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".
Was already reported by a certain person you know. :) *** This bug has been marked as a duplicate of bug 65105 ***