Page MenuHomePhabricator

Hook name does not match associated namespace name
Closed, DeclinedPublic

Description

In https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/OATHAuth/+/513090/ a new hook was created in OATHAuth to address T199118, but the naming convention was not followed and now we have ended up with a hook whose name starts with lower case g (getUserPermissionsErrors) and a corresponding namespace whose name starts with upper case g (namespace MediaWiki\Extension\OATHAuth\Hook\GetUserPermissionsErrors)

Before it's too late, we should correct this. If the hook is being used elsewhere already, we should fix those callbacks as well.

Event Timeline

Reedy triaged this task as High priority.Aug 1 2019, 7:30 PM

Is this actually a bug when the hook in core is lowercased at the start? And I don't think the Hook class does a case insensitive matching...

So using GetUserPermissionsErrors wouldn't actually work?

https://github.com/wikimedia/mediawiki/blob/7f646a219e50b8ef2fbc6f3226c39ae6793edf59/includes/Permissions/PermissionManager.php#L433

Reedy changed the task status from Open to Stalled.Aug 1 2019, 8:29 PM

a new hook was created in OATHAuth to address

A new subscriber was created. A new hook was not created

a new hook was created in OATHAuth to address

A new subscriber was created. A new hook was not created

I had misunderstood this. Never mind :)