[DDC-1163] entity persister gets superclasses' metadata for proxied subclass entity Created: 20/May/11  Updated: 05/Jun/11  Resolved: 05/Jun/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.0.3, 2.0.4, 2.0.5
Fix Version/s: 2.0.6, 2.1
Security Level: All

Type: Bug Priority: Critical
Reporter: Stan Imbt Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None
Environment:

PHP 5.3.6 on Debian Lenny & WinXP, PostgreSQL 8.4 & SQLite 3


Attachments: Zip Archive testcase.zip    

 Description   

Using class table inheritance:

When a proxy for a subclass-entity is registered at the unit of work and another entity, which references that entities' superclass, is added or removed, the employed entity persister gets/uses the superclasses' metadata.

If the change-set of the referenced entity contains fields only defined in the subclass, the persister will create bogus SQL because it has no column names or data types: UPDATE table SET = ? WHERE id = ?

The attached test case is stand-alone, creating an SQLite in-memory DB (sorry, I'm not familiar with your test suite).

Only the path to Doctrine must be adapted at the top of 'run_test.php'.
The file 'SubclassPropertyBugTest.php' also contains a more detailed description.



 Comments   
Comment by Benjamin Eberlei [ 05/Jun/11 ]

Verified on 2.0.5, interestingly this bug seems to have vanished in 2.1 / master. I will investigate whats wrong.

Comment by Benjamin Eberlei [ 05/Jun/11 ]

Found the problem and fixed it. Very nasty timing error with inheritance and a false check.

Generated at Wed Jul 30 03:06:18 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.