DDC-1610: Associations loaded in 'loadClassMetadata' event are not well initialized inside ClassMetadata #2020

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

Originally created by @doctrinebot on GitHub (Jan 18, 2012).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user gordonslondon:

Reproduce

  • I have an entity
  • I'm loading an association (named 'myfield') inside a LoadClassMetadata event.

Error

Then i get this error : Notice: Undefined index: myfield in /vendor/doctrine/lib/Doctrine/ORM/UnitOfWork.php line 2473

Problem

It seems that here https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php#L294 we call the method 'wakeupReflection' before the loadClassMetadata event is dispatched.

A solution

I've created a patch (all tests pass) here 0823cd54d0 that fixed the issue. Do you want a PR ?

Here's the PR : https://github.com/doctrine/doctrine2/pull/264

Originally created by @doctrinebot on GitHub (Jan 18, 2012). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user gordonslondon: ## Reproduce - I have an entity - I'm loading an association (named 'myfield') inside a `LoadClassMetadata` event. ## Error Then i get this error : Notice: Undefined index: myfield in /vendor/doctrine/lib/Doctrine/ORM/UnitOfWork.php line 2473 ## Problem It seems that here https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php#L294 we call the method 'wakeupReflection' before the loadClassMetadata event is dispatched. ## A solution I've created a patch (all tests pass) here https://github.com/gordonslondon/doctrine2/commit/0823cd54d0b2720f5e72aa9a29d16271904d99f0 that fixed the issue. Do you want a PR ? Here's the PR : https://github.com/doctrine/doctrine2/pull/264
admin added the Bug label 2026-01-22 13:37:45 +01:00
admin closed this issue 2026-01-22 13:37:46 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jan 21, 2012):

Comment created by @beberlei:

Fixed

@doctrinebot commented on GitHub (Jan 21, 2012): Comment created by @beberlei: Fixed
Author
Owner

@doctrinebot commented on GitHub (Jan 21, 2012):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jan 21, 2012): 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#2020