getEntityChangeSet method of UnitOfWork doesn't work on an array of 0 #6486

Closed
opened 2026-01-22 15:33:56 +01:00 by admin · 0 comments
Owner

Originally created by @Adm94 on GitHub (Jun 10, 2020).

Bug Report

Q A
BC Break no
Version 4.4.3

Summary

I use getEntityChangeSet to get changes in a OnFlush Listener.
My data is stored in a mysql longtext as DC2Type:array (i:0;)
When I update the value from 1 to 0. I do get an array of 'old/new' value.

array:1 [
  "value" => array:2 [
    0 => 1
    1 => 0
  ]
]

But not when I update from 0 to 1

Current behavior

When I update the value to 1, getEntityChangeSet method give me an empty array as value.

[]

How to reproduce

Update an array from an int 0 value

Expected behavior

array:1 [
  "value" => array:2 [
    0 => 0
    1 => 1
  ]
]

Is this a normal behavior ?

Originally created by @Adm94 on GitHub (Jun 10, 2020). ### Bug Report <!-- Fill in the relevant information below to help triage your issue. --> | Q | A |------------ | ------ | BC Break | no | Version | 4.4.3 #### Summary I use getEntityChangeSet to get changes in a OnFlush Listener. My data is stored in a mysql longtext as DC2Type:array (i:0;) When I update the value from 1 to 0. I do get an array of 'old/new' value. ```php array:1 [ "value" => array:2 [ 0 => 1 1 => 0 ] ] ``` But not when I update from 0 to 1 #### Current behavior When I update the value to 1, getEntityChangeSet method give me an empty array as value. ```php [] ``` #### How to reproduce Update an array from an int 0 value #### Expected behavior ```php array:1 [ "value" => array:2 [ 0 => 0 1 => 1 ] ] ``` Is this a normal behavior ?
admin closed this issue 2026-01-22 15:33:56 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6486