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 raised the priority of this task from to Needs Triage.
Tgr updated the task description. (Show Details)
Tgr added a project: MediaWiki-Configuration.
Tgr subscribed.
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

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

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

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