Last modified: 2010-01-06 13:27:07 UTC
Created attachment 4236 [details] Allows the backlinks query to return the standard data structure when the query returns an empty dataset. Some list type queries return the standard data structure but an empty dataset when, because of a supplied parameter, the query returns no results, for example, the categorymembers query: http://www.mediawiki.org/w/api.php?action=query&list=categorymembers&cmcategory=NonExistentCategory <?xml version="1.0" encoding="utf-8"?> <api> <query> <categorymembers /> </query> </api> However some don't return the standard data structure, for example, the backlinks query: http://www.mediawiki.org/w/api.php?action=query&list=backlinks&bltitle=NonExistentPage <?xml version="1.0" encoding="utf-8"?> <api /> And in another varient, although the usercontribs query returns the standard data structure with an empty dataset when a nonexistent user is specified, the logevents query returns an error when a nonexistent user is specified. Is there any good reason why these queries should behave differently? Attached is an extremely simple patch to allow the backlinks query to return the standard data structure when the query returns an empty dataset. I'll try to track how this can be addressed in the other affected queries.
Yeah, we should probably standardize these. Setting it as low-priority, though, as I don't think this is anything of particular urgency. Backlinks fixed in r26954. I'll try to get around to looking at the other queries some time (there are a lot of them though!).
Comment on attachment 4236 [details] Allows the backlinks query to return the standard data structure when the query returns an empty dataset. Marking patch as obsolete 'cause it's been applied already
Is this still an issue?
This would seem to be resolved (checking through they all are the same) bug 21991 is of a similar nature (how the bad inputs are dealt with - Empty data set, error)