[go: up one dir, main page]

Page MenuHomePhabricator

ApiQuerySiteInfo: add/remove user groups sometimes given as an object instead of array
Open, Needs TriagePublic

Description

See https://en.wikipedia.org/w/api.php?action=query&meta=siteinfo&indexpageids=1&siprop=usergroups

For admins: add and remove are arrays of group names
For crats: objects with non-sequential keys

API result
"add": {
	"1": "accountcreator",
	"2": "sysop",
	"3": "interface-admin",
	"4": "bureaucrat",
	"5": "bot",
	"6": "confirmed",
	"7": "copyviobot",
	"8": "reviewer"
},
"remove": {
	"0": "ipblock-exempt",
	"1": "sysop",
	"3": "accountcreator",
	"4": "bot",
	"5": "confirmed",
	"6": "interface-admin",
	"7": "copyviobot",
	"8": "reviewer"
}

Potential cause: T245716: InitialiseSettings: don't let enwiki crats add/remove flow-bot - the api result is different from the actual $wgAddGroups and $wgRemoveGroups from crats, and the alteration of the list of groups could result in the different format

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Anomie subscribed.

The current state is that it will always be an array if you're using formatversion=2, but it was left in this way for the default formatversion=1. I don't remember why I didn't just make it always arrays.

I don't think it would be a problem to fix this, and should be a 1-line change (replacing the appropriate 'BCarray' with 'array').

WDoranWMF subscribed.

@DannyS712, we would like to see this complete. Would you be interested/have time to make the patch and we can review? We'll icebox it for now and move it to in review if a patch arrives.

I have a lot on my plate right now, but I've added it to the queue

I tried to replicate this bug but it seems it has been fixed.
I also tried to trace the patch that possibly fixed this, however, I was unsuccessful at that attempt. There seems to be a function that is setting them to default arrays.

If anyone has insight on this, I'd appreciate that but from my investigations, this bug no longer exists and suggest we move to closing the ticket