Page MenuHomePhabricator

Hooks::register( 'Hook', [ self::class, 'onHook' ] ) doesn't work as expected
Closed, ResolvedPublic

Description

Forking from T283539: Error: Call to undefined function MediaWiki\Extension\Interwiki\Hooks(), but I know it's an issue I've seen before, and given up and just left the stringified class name behind

https://github.com/wikimedia/mediawiki-extensions-Interwiki/blob/7bb8875/includes/Hooks.php#L45

In this case, using [ self::class, 'onInterwikiLoadPrefix' ] results in an error like Error: Call to undefined function MediaWiki\Extension\Interwiki\Hooks()

Event Timeline

Ammarpad renamed this task from MWHooks::register( 'Hook', [ self::class, 'onHook' ] ) doesn't work as expected to Hooks::register( 'Hook', [ self::class, 'onHook' ] ) doesn't work as expected.May 25 2021, 5:34 AM

Change 694595 had a related patch set uploaded (by Ammarpad; author: Ammarpad):

[mediawiki/core@master] HookContainer: Fix normalization of callback for static handler

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

Change 695317 had a related patch set uploaded (by Reedy; author: Ammarpad):

[mediawiki/core@REL1_35] HookContainer: Fix normalization of callback for static handler

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

Change 695318 had a related patch set uploaded (by Reedy; author: Ammarpad):

[mediawiki/core@REL1_36] HookContainer: Fix normalization of callback for static handler

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

Change 694595 merged by jenkins-bot:

[mediawiki/core@master] HookContainer: Fix normalization of callback for static handler

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

Change 695317 merged by jenkins-bot:

[mediawiki/core@REL1_35] HookContainer: Fix normalization of callback for static handler

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

Change 695318 merged by jenkins-bot:

[mediawiki/core@REL1_36] HookContainer: Fix normalization of callback for static handler

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