Skip to content

Loading…

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

Closed
doctrinebot opened this Issue · 2 comments

2 participants

@doctrinebot

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 gordonslondon/doctrine2@0823cd5 that fixed the issue. Do you want a PR ?

Here's the PR : #264

@doctrinebot

Comment created by @beberlei:

Fixed

@doctrinebot

Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.2 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.