Page MenuHomePhabricator

Null values in number fields are forced to 0 on display
Closed, InvalidPublicBUG REPORT

Description

https://github.com/wikimedia/mediawiki-extensions-Cargo/blob/master/includes/CargoQueryDisplayer.php#L195

For both Integer and Float data types the PHP number_format function is used. This function transforms NULL to 0, which in a database context is incorrect.

NULLs in number data types should be represented as such and not transformed to 0.

Event Timeline

formatFieldValue() is already only called for non-null, non-blank values - no? Are you actually seeing a problem somewhere?

I'm closing this, since it appears to be a non-issue - please re-open it if it actually is a problem.