Last modified: 2011-12-01 14:55:15 UTC
In r43384n mediawiki crashed irremediably on loading. I've the following messages : Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'LatexDoc::on' was given in /var/www/wiki/includes/Hooks.php on line 119 Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'LatexDoc::on' was given in /var/www/wiki/includes/Hooks.php on line 119 MediaWiki internal error. Original exception: exception 'MWException' with message 'Detected bug in an extension! Hook LatexDoc::on failed to return a value; should return true to continue hook processing or false to abort.' in /var/www/wiki/includes/Hooks.php:160 Stack trace: #0 /var/www/wiki/includes/parser/Parser.php(324): wfRunHooks('ParserBeforeStr...', Array) #1 /var/www/wiki/extensions/FlaggedRevs/FlaggedRevs.class.php(280): Parser->parse('<div style="fon...', Object(Title), Object(ParserOptions), true, true, 9401) #2 /var/www/wiki/extensions/FlaggedRevs/FlaggedRevs.class.php(541): FlaggedRevs::parseStableText(Object(Article), '<div style="fon...', 9401) #3 /var/www/wiki/extensions/FlaggedRevs/FlaggedArticle.php(315): FlaggedRevs::stableVersionIsSynced(Object(FlaggedRevision), Object(Article)) #4 /var/www/wiki/extensions/FlaggedRevs/FlaggedRevs.hooks.php(1097): FlaggedArticle->setPageContent(false, false) #5 [internal function]: FlaggedRevsHooks::onArticleViewHeader(Object(Article), false, false) #6 /var/www/wiki/includes/Hooks.php(119): call_user_func_array(Array, Array) #7 /var/www/wiki/includes/Hooks.php(150): wfInvoke('FlaggedRevsHook...', Array) #8 /var/www/wiki/includes/Article.php(815): wfRunHooks('ArticleViewHead...', Array) #9 /var/www/wiki/includes/Wiki.php(440): Article->view() #10 /var/www/wiki/includes/Wiki.php(59): MediaWiki->performAction(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest)) #11 /var/www/wiki/index.php(93): MediaWiki->initialize(Object(Title), Object(Article), Object(OutputPage), Object(User), Object(WebRequest)) #12 {main} Exception caught inside exception handler: exception 'MWException' with message 'Detected bug in an extension! Hook LatexDoc::on failed to return a value; should return true to continue hook processing or false to abort.' in /var/www/wiki/includes/Hooks.php:160 Stack trace: #0 /var/www/wiki/includes/parser/Parser.php(462): wfRunHooks('ParserBeforeStr...', Array) #1 /var/www/wiki/includes/parser/Parser.php(3954): Parser->preprocess('$1 - {{SITENAME...', Object(Title), Object(ParserOptions)) #2 /var/www/wiki/includes/MessageCache.php(673): Parser->transformMsg('$1 - {{SITENAME...', Object(ParserOptions)) #3 /var/www/wiki/includes/GlobalFunctions.php(586): MessageCache->transform('$1 - {{SITENAME...') #4 /var/www/wiki/includes/GlobalFunctions.php(549): wfMsgGetKey('pagetitle', true, false, true) #5 /var/www/wiki/includes/GlobalFunctions.php(455): wfMsgReal('pagetitle', Array, true) #6 /var/www/wiki/includes/OutputPage.php(324): wfMsg('pagetitle', 'Erreur interne') #7 /var/www/wiki/includes/Exception.php(148): OutputPage->setPageTitle('Erreur interne') #8 /var/www/wiki/includes/Exception.php(183): MWException->reportHTML() #9 /var/www/wiki/includes/Exception.php(269): MWException->report() #10 /var/www/wiki/includes/Exception.php(318): wfReportException(Object(MWException)) #11 [internal function]: wfExceptionHandler(Object(MWException)) #12 {main}
(In reply to comment #0) > 'Detected bug in an > extension! Hook LatexDoc::on failed to return a value; should return true to > continue hook processing or false to abort.' Pretty obvious to me.
I don't understand. Can you explain me
The hook that the failing extension is trying to add is incorrect. It should return true, but it's not. Should be a fairly easy fix, I'm sure there will be a patch on here before I have a chance to get home and make one myself ;-)
I'm not so sure, it looks like it may be due to a recent modification to includes/Hooks.php. r43377 factored out the guts of wfRunHooks into a separate function. One of the several ways to specify a hook function is to pass an object which has a method "onEventName" for the appropriate hook; it seems the new function is trying to construct that "onEventName" at line 39 of Hooks.php, but fails because $event isn't passed down to the new function from wfRunHooks. In this case, LatexDoc would just be one extension that uses that method of specifying the event handler.
It seems that the problem is now in the LaTex Doc extension. After to have disabled it, the wiki seems running correctly.
More likely, none of your other modules specify hooks in that way. See [[mw:Manual:Hooks#Writing an event handler]] for all the different ways a module can specify an event handler function.
Created attachment 5522 [details] Possible patch This patch just adds an $event parameter to the new functions, so the event name may be passed down to where it is needed.
Marking fixed, Brion reverted r43377 in r43416.