DDC-920: Undefined index in UnitOfWork when detach entity without flush #1142

Closed
opened 2026-01-22 13:03:37 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Dec 9, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user panda:

This code causes undefined index

$entity = new ... // some entity

$em->persist($entity);
$em->detach($entity); // throw notice Doctrine/ORM/UnitOfWork.php on line 1114

But this works well

$entity = new ... // some entity

$em->persist($entity);
$em->flush();
$em->detach($entity);

Originally created by @doctrinebot on GitHub (Dec 9, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user panda: This code causes undefined index $entity = new ... // some entity $em->persist($entity); $em->detach($entity); // throw notice Doctrine/ORM/UnitOfWork.php on line 1114 But this works well $entity = new ... // some entity $em->persist($entity); $em->flush(); $em->detach($entity);
admin added the Bug label 2026-01-22 13:03:37 +01:00
admin closed this issue 2026-01-22 13:03:38 +01:00
Author
Owner

@doctrinebot commented on GitHub (Dec 10, 2010):

Comment created by @beberlei:

Fixed

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

@doctrinebot commented on GitHub (Dec 10, 2010):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Dec 10, 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#1142