On update, doctrine doesn't generate a changeset when the property changed is an entity #5578

Open
opened 2026-01-22 15:11:46 +01:00 by admin · 2 comments
Owner

Originally created by @fabricekabongo on GitHub (Jun 17, 2017).

Scenario

I have a Product entity and an Advert entity.
Advert 1 was linked to Product 1, I change it to be linked to Product 2.

Facts

The process calls Doctrine\ORM\UnitOfWork::executeUpdates and on line 1060 an Error is thrown:

Catchable Fatal Error: Argument 3 passed to Doctrine\ORM\Event\PreUpdateEventArgs::__construct() must be of the type array, null given, called in /var/www/project/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 1060 and defined

because $this->entityChangeSets[$oid] is null

Originally created by @fabricekabongo on GitHub (Jun 17, 2017). ## Scenario I have a `Product` entity and an `Advert` entity. Advert 1 was linked to Product 1, I change it to be linked to Product 2. ## Facts The process calls `Doctrine\ORM\UnitOfWork::executeUpdates` and on line `1060` an Error is thrown: Catchable Fatal Error: Argument 3 passed to Doctrine\ORM\Event\PreUpdateEventArgs::__construct() must be of the type array, null given, called in /var/www/project/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 1060 and defined because `$this->entityChangeSets[$oid]` is null
admin added the Missing Tests label 2026-01-22 15:11:46 +01:00
Author
Owner

@Ocramius commented on GitHub (Jun 17, 2017):

Requires a test case

On Jun 17, 2017 11:38, "Fabrice Kabongo" notifications@github.com wrote:

Scenario

I have a Product entity and an Advert entity.
Advert 1 was linked to Product 1, I change it to be linked to Product 2.
Facts

The process calls Doctrine\ORM\UnitOfWork::executeUpdates and on line 1060
an Error is thrown:

Catchable Fatal Error: Argument 3 passed to Doctrine\ORM\Event
PreUpdateEventArgs::__construct() must be of the type array, null given,
called in /var/www/project/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php
on line 1060 and defined

because $this->entityChangeSets[$oid] is nul


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/doctrine/doctrine2/issues/6505, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAJakBBvCSGgwkJ-xWZCpjU0YUt-orVDks5sE4sngaJpZM4N9Kiv
.

@Ocramius commented on GitHub (Jun 17, 2017): Requires a test case On Jun 17, 2017 11:38, "Fabrice Kabongo" <notifications@github.com> wrote: > Scenario > > I have a Product entity and an Advert entity. > Advert 1 was linked to Product 1, I change it to be linked to Product 2. > Facts > > The process calls Doctrine\ORM\UnitOfWork::executeUpdates and on line 1060 > an Error is thrown: > > Catchable Fatal Error: Argument 3 passed to Doctrine\ORM\Event\ > PreUpdateEventArgs::__construct() must be of the type array, null given, > called in /var/www/project/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php > on line 1060 and defined > > because $this->entityChangeSets[$oid] is nul > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > <https://github.com/doctrine/doctrine2/issues/6505>, or mute the thread > <https://github.com/notifications/unsubscribe-auth/AAJakBBvCSGgwkJ-xWZCpjU0YUt-orVDks5sE4sngaJpZM4N9Kiv> > . >
Author
Owner

@razbakov commented on GitHub (Sep 6, 2018):

Same problem as #7387

@razbakov commented on GitHub (Sep 6, 2018): Same problem as #7387
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5578