mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-3863: Wrong return if value is null in JsonArrayType #4729
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Aug 3, 2015).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user talus:
On the JsonArray type, on the conversion from a database value to a php value, if the value is null or empty, it returns an empty array.
The thing is, I have a inherited field (or more specifically two fields with the same name, which is not in the parent entity (as another subentity doesn't need such a field).
Basically, it tries to load the field which appears two times (for a field name called
field, it has two columns in thedataarray :field*1andfield_2). The value for a entity has one of these null, respectively thefield_1for the first subentity, andfield*2for the second subentity.The JsonArrayType then recognizes the field named
fieldin the data, and returns an empty array if the value is null... Then doctrine stores in into cache, but when it comes to the second field (field_2), as it sees he has a cache forfield, it ignores the value as the value is not null.So basically, the problems lies within the JsonArrayType, which should return null if the value is null ? But I'm not quite sure if this is BC...
I was not sure if this belonged to the orm or the dbal.