Last modified: 2010-01-06 13:27:07 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 11588 - List type queries treat empty datasets inconsistently
List type queries treat empty datasets inconsistently
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-07 13:07 UTC by Stephen Bain
Modified: 2010-01-06 13:27 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Allows the backlinks query to return the standard data structure when the query returns an empty dataset. (476 bytes, patch)
2007-10-07 13:07 UTC, Stephen Bain
Details

Description Stephen Bain 2007-10-07 13:07:10 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.
Comment 1 Daniel Cannon (AmiDaniel) 2007-10-26 04:01:14 UTC
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 2 Roan Kattouw 2008-05-08 16:55:29 UTC
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
Comment 3 Alex Z. 2009-07-21 05:36:33 UTC
Is this still an issue?
Comment 4 Sam Reed (reedy) 2010-01-06 13:27:07 UTC
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) 

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links