DDC-710: DecimalType - NULL in database should be NULL not 0 #877

Closed
opened 2026-01-22 12:53:33 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Jul 21, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user pschwisow:

DecimalType::convertToPHPValue should return NULL if the value in the database is NULL. This is similar to the issue with IntegerType that was fixed with #DDC-571.

The fix would be to replace

return (double) $value;

with

return is_null($value) ? null : (double) $value;

Originally created by @doctrinebot on GitHub (Jul 21, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user pschwisow: DecimalType::convertToPHPValue should return NULL if the value in the database is NULL. This is similar to the issue with IntegerType that was fixed with #[DDC-571](http://www.doctrine-project.org/jira/browse/DDC-571). The fix would be to replace `return (double) $value;` with `return is_null($value) ? null : (double) $value;`
admin added the Bug label 2026-01-22 12:53:33 +01:00
admin closed this issue 2026-01-22 12:53:33 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jul 21, 2010):

Comment created by @beberlei:

Fixed

@doctrinebot commented on GitHub (Jul 21, 2010): Comment created by @beberlei: Fixed
Author
Owner

@doctrinebot commented on GitHub (Jul 21, 2010):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jul 21, 2010): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#877