Page MenuHomePhabricator

DynamicPageList uncaught exception PHP fatal error
Open, Needs TriagePublic

Description

Version: 1.30 RC

DynamicPageList is giving a PHP fatal error, causing the site to give a HTTP 500.

PHP Fatal error:  Uncaught exception 'UnexpectedValueException' with message 'callback 'DynamicPageListHooks::onRegistration' is not callable' in /srv/mediawiki/w/includes/registration/ExtensionRegistry.php:339

The repo is "intersection"

Event Timeline

Is there a stacktrace for this?

@Addshore backtrace:

[01-Dec-2017 20:02:21 UTC] PHP Fatal error:  Uncaught exception 'UnexpectedValueException' with message 'callback 'DynamicPageListHooks::onRegistration' is not callable' in /srv/mediawiki/w/includes/registration/ExtensionRegistry.php:339
Stack trace:
#0 /srv/mediawiki/w/includes/registration/ExtensionRegistry.php(149): ExtensionRegistry->exportExtractedData(Array)
#1 /srv/mediawiki/w/includes/Setup.php(40): ExtensionRegistry->loadFromQueue()
#2 /srv/mediawiki/w/includes/WebStart.php(114): require_once('/srv/mediawiki/...')
#3 /srv/mediawiki/w/index.php(40): require('/srv/mediawiki/...')
#4 {main}
  thrown in /srv/mediawiki/w/includes/registration/ExtensionRegistry.php on line 339

We have been using wfLoad before (with 1.29) so there must be a new change which has provoked this error.

Ahh the Intersection extension (with the internal name DynamicPageList )

Exactly which repo are you checking code out from?
Are you definately on REL1_30?

REL1_30 from gerrit has no reference to DynamicPageListHooks::onRegistration https://github.com/wikimedia/mediawiki-extensions-intersection/blob/REL1_30/extension.json
1.29 .28 etc also do not.

It looks like other versions of this extension do however https://github.com/search?q=DynamicPageListHooks%3A%3AonRegistration&type=Code&utf8=%E2%9C%93
And they also have the method implemented https://github.com/Alexia/DynamicPageList/blob/master/DynamicPageList.hooks.php#L115

I found https://github.com/miraheze/mediawiki/tree/REL1_30/extensions on gerrit.

DynamicPageList @ 9acf000
DynamicPageList3 @ 92c3965

It looks like you are also loading this 3 repo
https://github.com/miraheze/mw-config/blob/778f697938fe47d778f1fe5e2bc715ecfde22819/LocalExtensions.php#L166

That points to https://github.com/wikimedia/mediawiki-extensions-intersection/tree/9acf0001d785597b4154f2e74c39449fc32cf162 and https://github.com/Alexia/DynamicPageList/tree/92c39650090169b418bd399b97003ee6e842fe1a

Where you have a callback registered
https://github.com/Alexia/DynamicPageList/blob/92c39650090169b418bd399b97003ee6e842fe1a/extension.json#L69
And a method correctly placed
https://github.com/Alexia/DynamicPageList/blob/92c39650090169b418bd399b97003ee6e842fe1a/DynamicPageList.hooks.php

However the classes for both DynamicPageList and DynamicPageList3 both have the same names are are not namespaced.
As a result the first class with a given name will be loaded.

When you call wfLoadExtension for DynamicPageList3, it gets the DynamicPageListHooks class from DynamicPageList which does not have the method.
I don't recommend loading both of these extensions on the same wiki. These extensions should probably all be namespaced or have their classes renamed.

You should not be running both of these extensions at the same time. Intersection is a legacy extension and fork/branch of the previous iterations of DPL.

@Alexia Well we are a wiki farm, so they are ran on different wikis, but I was testing them on a testwiki. If possible, it would still be nice if they could be namespaced.

@Reception123 DPL3 is meant to replace all previous iterations of DPL.