[DDC-1610] Associations loaded in 'loadClassMetadata' event are not well initialized inside ClassMetadata Created: 18/Jan/12  Updated: 21/Jan/12  Resolved: 21/Jan/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: Git Master
Fix Version/s: 2.2
Security Level: All

Type: Bug Priority: Major
Reporter: jules b Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None



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


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


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

Comment by Benjamin Eberlei [ 21/Jan/12 ]


Generated at Sat Oct 10 01:27:05 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.