Last modified: 2014-01-30 18:55:50 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T61953, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 59953 - action=query&meta=filerepoinfo reports boolean not in api way for xml format
action=query&meta=filerepoinfo reports boolean not in api way for xml format
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.23.0
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-11 19:46 UTC by db [inactive,noenotif]
Modified: 2014-01-30 18:55 UTC (History)
6 users (show)

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


Attachments

Description db [inactive,noenotif] 2014-01-11 19:46:46 UTC
When using action=query&meta=filerepoinfo the boolean attributes like local, fetchDescription or initialCapital does not follow the api rules for boolean.

Api rules for boolean in xml is a existing attribute for true and no attribute for false, but in this module a value of 1 is true and nothing is false, which can be missleading.

For json all looks okay, because the true/false is reported as is and not formatted to a string representing value like on xml.
Comment 1 Brad Jorsch 2014-01-13 15:19:26 UTC
If only it weren't for backwards compatibility, it'd be nice to actually return booleans as booleans everywhere in the non-XML formats rather than the silly present-with-falsey-value/absent that comes legacy from the XML format.
Comment 2 db [inactive,noenotif] 2014-01-13 19:13:18 UTC
Yah, but mixed style is also bad, and when the one false looks like the other true, that is very bad.

That sounds like a idea for version 2.
Comment 3 Gerrit Notification Bot 2014-01-19 09:43:43 UTC
Change 108315 had a related patch set uploaded by Umherirrender:
treat true as empty string, skip false in xml format

https://gerrit.wikimedia.org/r/108315
Comment 4 Gerrit Notification Bot 2014-01-30 18:34:35 UTC
Change 108315 merged by jenkins-bot:
treat true as empty string, skip false in xml format

https://gerrit.wikimedia.org/r/108315
Comment 5 Umherirrender 2014-01-30 18:55:50 UTC
successfully merged, the xml format will now adjust the output for booleans, so trues are now empty strings and false skipped.
This allows using booleans for the other formats, which can make code path a bit easier (in the future), because no extra ifs are needed to add empty strings to the output, instead you can use the condition as is.

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


Navigation
Links