Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "EventListenerRegistry.php: Call to a member function getArticleID() on null" #2692

Merged
merged 1 commit into from Sep 23, 2017

Conversation

Projects
None yet
4 participants
@mwjames
Copy link
Contributor

mwjames commented Sep 23, 2017

This PR is made in reference to: #

This PR addresses or contains:

[4bda863a79a1e4504be4a2c5] /mw-master/index.php?title=Special%3ASemanticMediaWiki&action=lookup&id=122776&dispose=yes Error from line 57 of ...\mw-master\extensions\SemanticMediaWiki\src\EventListenerRegistry.php: Call to a member function getArticleID() on null

Backtrace:

#0 [internal function]: SMW\EventListenerRegistry->SMW\{closure}(Onoi\EventDispatcher\DispatchContext)
#1 ...\mw-master\vendor\onoi\event-dispatcher\src\Listener\GenericCallbackEventListener.php(62): call_user_func_array(Closure, array)
#2 ...\mw-master\vendor\onoi\event-dispatcher\src\Dispatcher\GenericEventDispatcher.php(122): Onoi\EventDispatcher\Listener\GenericCallbackEventListener->execute(Onoi\EventDispatcher\DispatchContext)
#3 ...\mw-master\extensions\SemanticMediaWiki\src\SQLStore\PropertyTableIdReferenceDisposer.php(243): Onoi\EventDispatcher\Dispatcher\GenericEventDispatcher->dispatch(string, Onoi\EventDispatcher\DispatchContext)
#4 ...\mw-master\extensions\SemanticMediaWiki\src\SQLStore\PropertyTableIdReferenceDisposer.php(137): SMW\SQLStore\PropertyTableIdReferenceDisposer->triggerCleanUpEvents(SMW\DIWikiPage, boolean)
#5 ...\mw-master\extensions\SemanticMediaWiki\src\MediaWiki\Jobs\EntityIdDisposerJob.php(60): SMW\SQLStore\PropertyTableIdReferenceDisposer->cleanUpTableEntriesById(integer)
#6 ...\mw-master\extensions\SemanticMediaWiki\src\MediaWiki\Specials\Admin\EntityLookupTaskHandler.php(126): SMW\MediaWiki\Jobs\EntityIdDisposerJob->dispose(integer)
#7 ...\mw-master\extensions\SemanticMediaWiki\src\MediaWiki\Specials\Admin\EntityLookupTaskHandler.php(108): SMW\MediaWiki\Specials\Admin\EntityLookupTaskHandler->doDispose(string)
#8 ...\mw-master\extensions\SemanticMediaWiki\src\MediaWiki\Specials\SpecialAdmin.php(173): SMW\MediaWiki\Specials\Admin\EntityLookupTaskHandler->handleRequest(WebRequest)
#9 ...\mw-master\includes\specialpage\SpecialPage.php(522): SMW\MediaWiki\Specials\SpecialAdmin->execute(NULL)
#10 ...\mw-master\includes\specialpage\SpecialPageFactory.php(578): SpecialPage->run(NULL)
#11 ...\mw-master\includes\MediaWiki.php(287): SpecialPageFactory::executePath(Title, RequestContext)
#12 ...\mw-master\includes\MediaWiki.php(851): MediaWiki->performRequest()
#13 ...\mw-master\includes\MediaWiki.php(523): MediaWiki->main()
#14 ...\mw-master\index.php(43): MediaWiki->run()
#15 {main}

This PR includes:

  • Tests (unit/integration)
  • CI build passed

@mwjames mwjames merged commit 28bf7e4 into master Sep 23, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@mwjames mwjames deleted the title-null branch Sep 23, 2017

mwjames added a commit that referenced this pull request Sep 23, 2017

@mwjames

This comment has been minimized.

Copy link
Contributor Author

mwjames commented Sep 23, 2017

Back-ported to 2.5.x with 5ddd9ca.

@D-Groenewegen

This comment has been minimized.

Copy link

D-Groenewegen commented Sep 23, 2017

Thanks, we bumped into this error message just this week.

@mwjames

This comment has been minimized.

Copy link
Contributor Author

mwjames commented Sep 23, 2017

we bumped into this error message just this week

How so? It only appears on an edge case!

@D-Groenewegen

This comment has been minimized.

Copy link

D-Groenewegen commented Sep 23, 2017

We're living on the edge I guess?

@mwjames

This comment has been minimized.

Copy link
Contributor Author

mwjames commented Sep 23, 2017

We're living on the edge I guess?

What did you do and where did it appear (stack trace would be good)?

@D-Groenewegen

This comment has been minimized.

Copy link

D-Groenewegen commented Sep 23, 2017

Since I'll be away from work, I'll ask one of my colleagues to come back to this next week.

@WSViktorS

This comment has been minimized.

Copy link

WSViktorS commented Oct 12, 2017

Hi James, sorry for the late reply.

Here is the stack trace:

.Exception encountered, of type "Error"
[4a726ff5577aea08ab107f03] [no req]   Error from line 57 of /.../extensions/SemanticMediaWiki/src/EventListenerRegistry.php: Call to a member function getArticleID() on null
Backtrace:
#0 [internal function]: SMW\EventListenerRegistry->SMW\{closure}(Onoi\EventDispatcher\DispatchContext)
#1 /.../public_html/vendor/onoi/event-dispatcher/src/Listener/GenericCallbackEventListener.php(62): call_user_func_array(Closure, array)
#2 /.../public_html/vendor/onoi/event-dispatcher/src/Dispatcher/GenericEventDispatcher.php(122): Onoi\EventDispatcher\Listener\GenericCallbackEventListener->execute(Onoi\EventDispatcher\DispatchContext)
#3 /.../public_html/extensions/SemanticMediaWiki/src/SQLStore/PropertyTableIdReferenceDisposer.php(237): Onoi\EventDispatcher\Dispatcher\GenericEventDispatcher->dispatch(string, Onoi\EventDispatcher\DispatchContext)
#4 /.../public_html/extensions/SemanticMediaWiki/src/SQLStore/PropertyTableIdReferenceDisposer.php(136): SMW\SQLStore\PropertyTableIdReferenceDisposer->triggerCleanUpEvents(SMW\DIWikiPage, boolean)
#5 /.../public_html/extensions/SemanticMediaWiki/src/SQLStore/PropertyTableIdReferenceDisposer.php(111): SMW\SQLStore\PropertyTableIdReferenceDisposer->cleanUpTableEntriesById(string)
#6 /.../public_html/extensions/SemanticMediaWiki/src/MediaWiki/Jobs/EntityIdDisposerJob.php(63): SMW\SQLStore\PropertyTableIdReferenceDisposer->cleanUpTableEntriesByRow(stdClass)
#7 /.../public_html/extensions/SemanticMediaWiki/src/Maintenance/DataRebuilder.php(410): SMW\MediaWiki\Jobs\EntityIdDisposerJob->dispose(stdClass)
#8 /.../public_html/extensions/SemanticMediaWiki/src/Maintenance/DataRebuilder.php(226): SMW\Maintenance\DataRebuilder->doDisposeMarkedOutdatedEntities()
#9 /.../public_html/extensions/SemanticMediaWiki/src/Maintenance/DataRebuilder.php(168): SMW\Maintenance\DataRebuilder->doRebuildAll()
#10 /.../public_html/extensions/SemanticMediaWiki/maintenance/rebuildData.php(150): SMW\Maintenance\DataRebuilder->rebuild()
#11 /.../public_html/maintenance/doMaintenance.php(103): SMW\Maintenance\RebuildData->execute()
#12 /.../public_html/extensions/SemanticMediaWiki/maintenance/rebuildData.php(198): require_once(string)
#13 {main}
@Sen-Sai

This comment has been minimized.

Copy link

Sen-Sai commented Oct 12, 2017

Hi mwjames,
Could you elaborate what the problem was and if there is something we can do to avoid ?

@mwjames

This comment has been minimized.

Copy link
Contributor Author

mwjames commented Oct 14, 2017

Could you elaborate what the problem

The problem is "... Call to a member function getArticleID() on null ..." on a Title that doesn't exit anymore hence we need to avoid trying to call up the instance.

if there is something we can do to avoid ?

#2692 (comment)

@mwjames

This comment has been minimized.

Copy link
Contributor Author

mwjames commented Oct 14, 2017

Hi James, sorry for the late reply.
Here is the stack trace:

Thanks, it just confirms to have the same root cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.