Last modified: 2008-09-03 14:48:07 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 T17448, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 15448 - YAML-Output returns empty values instead of 0
YAML-Output returns empty values instead of 0
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.12.x
All All
: Normal normal (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-02 20:53 UTC by Michael Holzt
Modified: 2008-09-03 14:48 UTC (History)
2 users (show)

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


Attachments

Description Michael Holzt 2008-09-02 20:53:18 UTC
See for example http://de.wikinews.org/w/api.php?action=query&prop=info&titles=Hauptseite&format=yaml compared to http://de.wikinews.org/w/api.php?action=query&prop=info&titles=Hauptseite

Both the namespace (ns) and the counter variable are numerical zero but in the yaml output the value is just empty.
Comment 1 Roan Kattouw 2008-09-03 14:48:07 UTC
Upon seeing this bug, my first instinct was that PHP's weak type system was to blame, and that someone had done $var == '' somewhere (which is true if $var is '0'). It turned out there was a == '' in the YAML formatter, but that didn't cause the bug. It was plain, old-fashioned, non-PHP-related stupidity in the form of if($value), which was probably intended to be false for null and empty strings, but is also false for 0 and '0'.

Fixed in r40384.

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


Navigation
Links