postLoad execute UPDATE instead of updating Entity state. #5809

Open
opened 2026-01-22 15:18:30 +01:00 by admin · 1 comment
Owner

Originally created by @unckleg on GitHub (Dec 18, 2017).

I have Entity Menu that has a collection of Page Entities.
Page entity has a postLoad event which is setting Image field to a Symfony compatible format.

Whenever I update Menu Entity it will also trigger UPDATE for Image field to DB for all Collection related Page entities, but It should just mutate Entity object how familiar I am with Doctrine Event listeners.

This is also related to: https://github.com/doctrine/doctrine2/issues/4507

Originally created by @unckleg on GitHub (Dec 18, 2017). I have **Entity Menu** that has a collection of **Page** Entities. Page entity has a **postLoad** event which is setting **Image field** to a Symfony compatible format. Whenever I update **Menu Entity** it will also trigger UPDATE for Image field to DB for all Collection related Page entities, but It should just mutate Entity object how familiar I am with Doctrine Event listeners. This is also related to: https://github.com/doctrine/doctrine2/issues/4507
admin added the BugMissing Tests labels 2026-01-22 15:18:30 +01:00
Author
Owner

@lcobucci commented on GitHub (Dec 18, 2017):

@unckleg could you please send us a failing test case that reproduces that behaviour? It would help us a lot to identify and fix the issue you're describing.

You can find examples on 388afb46d0/tests/Doctrine/Tests/ORM/Functional/Ticket

@lcobucci commented on GitHub (Dec 18, 2017): @unckleg could you please send us a failing test case that reproduces that behaviour? It would help us a lot to identify and fix the issue you're describing. You can find examples on https://github.com/doctrine/doctrine2/tree/388afb46d0cb3ed0c51332e8df0de9e942c2690b/tests/Doctrine/Tests/ORM/Functional/Ticket
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5809