API gets confused about where CentralAuth API modules come from
Open, LowestPublic

Description

Not an API bug, more of "lol centralauth". https://en.wikipedia.org/w/api.php?action=help&modules=centralauthtoken says "Source: AntiSpoof for CentralAuth" because we have multiple "extensions" pointing to the same directory.

Legoktm created this task.Jul 24 2015, 12:37 AM
Legoktm updated the task description. (Show Details)
Legoktm raised the priority of this task from to Lowest.
Legoktm added a subscriber: Legoktm.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 24 2015, 12:37 AM
Reedy added a subscriber: Reedy.Nov 21 2015, 4:46 PM

It's the same for all the CA api modules it seems...

Reedy added a comment.Nov 21 2015, 4:47 PM
This comment was removed by Reedy.
Reedy added a comment.Nov 21 2015, 4:52 PM

Presumably it's because it comes across the AntiSpoof modules before CA itself?

Anomie added a subscriber: Anomie.Nov 23 2015, 4:47 PM

Presumably it's because it comes across the AntiSpoof modules before CA itself?

The current ApiBase::getModuleSourceInfo() code actually takes the last match in $wgExtensionCredits for the directory, and $wgExtensionCredits['antispam'] winds up after $wgExtensionCredits['specialpage'] in the array. Making it "first match" instead would by chance probably fix CentralAuth as things are right now, but there's no guarantee that some future configuration change wouldn't cause $wgExtensionCredits['antispam'] to start coming first, and even if that doesn't happen it would misattribute any CA-sub-extension API modules as belong to the main CA extension were some sub-extension to get an API module.

The real fix is to put sub-extensions in subdirectories, like ConfirmEdit does. Or as long as ignoring the "misattribute any CA-sub-extension API modules" is ok, extend $wgExtensionCredits to have a property that indicates which is the "main" extension and have the API preferentially choose that when there are conflicts.

Krenair added a subscriber: Krenair.Jan 5 2016, 7:22 AM