Page MenuHomePhabricator

Cannot register multiple functions for the same hook in extension registry
Closed, ResolvedPublic

Description

I would expect this to work:

...
    "Hooks": {
        ...
        "LoadExtensionSchemaUpdates": [
            "Gather\\UpdaterHooks::onLoadExtensionSchemaUpdates",
            "Gather\\UpdaterHooks::onLoadExtensionSchemaUpdatesBC"
         ]
    }

but actually it will call Gather\UpdaterHooks::onLoadExtensionSchemaUpdates with the string "Gather\\UpdaterHooks::onLoadExtensionSchemaUpdatesBC" as the first parameter.

Event Timeline

Tgr created this task.May 13 2015, 4:14 PM
Tgr raised the priority of this task from to Needs Triage.
Tgr updated the task description. (Show Details)
Tgr added a project: MediaWiki-Configuration.
Tgr added a subscriber: Tgr.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 13 2015, 4:14 PM
Tgr triaged this task as Low priority.May 13 2015, 4:14 PM

The obvious workaround is to call one hook handler from the other.

Change 210761 had a related patch set uploaded (by Legoktm):
registration: Fix having multiple callbacks for a single hook

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

Legoktm claimed this task.May 13 2015, 7:30 PM

Change 210761 merged by jenkins-bot:
registration: Fix having multiple callbacks for a single hook

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

Tgr closed this task as Resolved.May 13 2015, 9:13 PM

Change 231980 had a related patch set uploaded (by Legoktm):
registration: Fix having multiple callbacks for a single hook

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

Change 231980 merged by jenkins-bot:
registration: Fix having multiple callbacks for a single hook

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