Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fixed classIsNotAValidEntity problem #102

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

grizlik commented Feb 7, 2012

I don't know how it works earlier, but after update symfony and all Doctrine packages I have a headache on my production server: AnnotationDriver throws exception classIsNotAValidEntityOrMappedSuperClass, because in this code
// Compatibility with Doctrine Common 3.x
if ($classAnnotations && is_int(key($classAnnotations))) {
foreach ($classAnnotations as $annot) {
$classAnnotations[get_class($annot)] = $annot;
}
}
key($classAnnotations) returns null, because annotations readed from cache and internal pointer is set to last element! In development all works fine, because annotations is readed from file, not from cache.
I resolve this problem adding code reset($data) to CachedReader, but has many ways for resolve that

grizlik commented Feb 14, 2012

Maybe someone answer to my pull request? If it is not needed, tell me about it. I have a problem with ApcCache.

Member

stof commented Feb 14, 2012

@grizlik can you write a unit test showing the issue (meaning it should fail with the current code and pass with your fix) ?

Member

stof commented Mar 31, 2012

@grizlik ping

grizlik commented Apr 2, 2012

i will try to do this some later. I'm sorry, but i have not enough time now :(

Owner

Ocramius commented Nov 8, 2012

@grizlik news?

grizlik commented Nov 11, 2012

hi. i have some problems with it, because exception throws in Doctrine/ORM/Mapping/Driver/AnnotationDriver.php (in doctrine-orm project), but "seat of the trouble" located in Doctrine/Common/Annotations/CachedReader.php (doctrine-common project). where i write the test?

Owner

Ocramius commented Nov 11, 2012

@grizlik I think the failing test should be written in common. The ORM is throwing the exception, but it depends on this problem as it seems.

Owner

Ocramius commented Dec 23, 2013

Annotations have been moved to https://github.com/doctrine/annotations - if this is still a problem, please open a PR against that repo.

@Ocramius Ocramius closed this Dec 23, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment