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

Huji created this task.Aug 1 2019, 5:31 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 1 2019, 5:31 PM
Huji updated the task description. (Show Details)Aug 1 2019, 5:32 PM
Reedy triaged this task as High priority.Aug 1 2019, 7:30 PM
D3r1ck01 updated the task description. (Show Details)Aug 1 2019, 7:31 PM
Reedy added a comment.Aug 1 2019, 7:40 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

Huji closed this task as Declined.Aug 1 2019, 10:43 PM

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 :)