Page MenuHomePhabricator

Argument 1 passed to SidebarHookHandlers::onParserAfterParse() must be an instance of Parser
Closed, ResolvedPublic

Description

Catchable fatal error: Argument 1 passed to Wikibase\Client\Hooks\SidebarHookHandlers::onParserAfterParse() must be an instance of Parser, none given at /srv/mediawiki/php-1.25wmf1/extensions/Wikidata/extensions/Wikibase/client/includes/hooks/SidebarHookHandlers.php on line 123

http://en.wikipedia.org/w/index.php?title=Special:MathShowImage&hash=24a17d2e2b000c187e42eafb8faf1059&mode=0

Backtrace:
#0 /srv/mediawiki/php-1.25wmf1/extensions/Wikidata/extensions/Wikibase/client/includes/hooks/SidebarHookHandlers.php(123): Wikibase\Client\Hooks\SidebarHookHandlers::onParserAfterParse()
#1 [internal function]: Wikibase\Client\Hooks\SidebarHookHandlers::onParserAfterParse()
#2 /srv/mediawiki/php-1.25wmf1/includes/Hooks.php(206): call_user_func_array('\Wikibase\Clien...', Array)
#3 /srv/mediawiki/php-1.25wmf1/includes/GlobalFunctions.php(3991): Hooks::run('ParserAfterPars...', Array, NULL)
#4 /srv/mediawiki/php-1.25wmf1/extensions/Math/SpecialMathShowImage.php(97): wfRunHooks('ParserAfterPars...')
#5 /srv/mediawiki/php-1.25wmf1/includes/specialpage/SpecialPage.php(363): SpecialMathShowImage->execute(NULL)
#6 /srv/mediawiki/php-1.25wmf1/includes/specialpage/SpecialPageFactory.php(562): SpecialPage->run(NULL)
#7 /srv/mediawiki/php-1.25wmf1/includes/MediaWiki.php(275): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#8 /srv/mediawiki/php-1.25wmf1/includes/MediaWiki.php(584): MediaWiki->performRequest()
#9 /srv/mediawiki/php-1.25wmf1/includes/MediaWiki.php(435): MediaWiki->main()
#10 /srv/mediawiki/php-1.25wmf1/index.php(46): MediaWiki->run()
#11 /srv/mediawiki/w/index.php(3): require('/srv/mediawiki/...')


Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=56769

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:53 AM
bzimport added a project: Math.
bzimport set Reference to bz71772.
bzimport added a subscriber: Unknown Object (MLST).
aude created this task.Oct 8 2014, 12:49 AM

gerritadmin wrote:

Change 165440 had a related patch set uploaded by Thiemo Mättig (WMDE):
Workaround for invalid ParserAfterParse hook call

https://gerrit.wikimedia.org/r/165440

aude added a comment.Oct 8 2014, 12:22 PM

problem is that SpecialMathShowImage is calling wfRunHooks('ParserAfterParse') with no parameters, inconsistent with the hook definition:

www.mediawiki.org/wiki/Manual:Hooks/ParserAfterParse

so, in the Wikibase hook handler, $parser and other parameters are null.

it would be much better if Math would directly call whatever specific method(s) that can save the file, rather than triggering the hook.

physik wrote:

would it be better to user wfRunHooks('ParserAfterParse' , '', null ); instead

gerritadmin wrote:

Change 165488 had a related patch set uploaded by Aude:
Workaround for invalid ParserAfterParse hook call

https://gerrit.wikimedia.org/r/165488

gerritadmin wrote:

Change 165440 merged by jenkins-bot:
Workaround for invalid ParserAfterParse hook call

https://gerrit.wikimedia.org/r/165440

gerritadmin wrote:

Change 165488 merged by jenkins-bot:
Workaround for invalid ParserAfterParse hook call

https://gerrit.wikimedia.org/r/165488

aude added a comment.Dec 11 2014, 3:53 PM

seems the bug is happening again.

Argument 1 passed to Wikibase\Client\Hooks\DataUpdateHookHandlers::onParserAfterParse() must be an instance of Parser, undefined variable given in /srv/mediawiki/php-1.25wmf11/extensions/Wikidata/extensions/Wikibase/client/includes/hooks/DataUpdateHookHandlers.php on line 73

also seeing:

#012Warning: onParserAfterParse() expects exactly 3 parameters, 0 given in /srv/mediawiki/php-1.25wmf11/extensions/Wikidata/extensions/Wikibase/client/includes/hooks/DataUpdateHookHandlers.php on line 73

Change 179143 had a related patch set uploaded (by Aude):
Avoid fatal in ParserAfterParser hook handling

https://gerrit.wikimedia.org/r/179143

Patch-For-Review

aude added a comment.Dec 11 2014, 3:55 PM

would also like this fixed in the Math extension. i would need to look at the code again, but really don't think it should be calling the hook. there must be another solution.

Change 179143 merged by jenkins-bot:
Avoid fatal in ParserAfterParser hook handling

https://gerrit.wikimedia.org/r/179143

Change 180067 had a related patch set uploaded (by Aude):
Avoid fatal in ParserAfterParser hook handling

https://gerrit.wikimedia.org/r/180067

Patch-For-Review

Change 180067 merged by jenkins-bot:
Avoid fatal in ParserAfterParser hook handling

https://gerrit.wikimedia.org/r/180067