Page MenuHomePhabricator

YAML-Output returns empty values instead of 0
Closed, ResolvedPublic


Author: wikimedia-bugreports

See for example compared to

Both the namespace (ns) and the counter variable are numerical zero but in the yaml output the value is just empty.

Version: 1.12.x
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:18 PM
bzimport set Reference to bz15448.

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.