[DDC-1208] doctrine-mapping.xsd does not allow for namespacing in discriminator-mapping element Created: 15/Jun/11  Updated: 15/Jun/11  Resolved: 15/Jun/11

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

Type: Bug Priority: Minor
Reporter: Bob Pupazzoni Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None
Environment:

Ay



 Description   

The XSD type for the 'class' attribute in the 'discriminator-mapping' element is 'xs:NMTOKEN'. But this does not allow the '\' characters used for PHP namespacing. The 'type' should instead be changed to 'xs:string' as shown below:

<xs:complexType name="discriminator-mapping">
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
</xs:sequence>
<xs:attribute name="value" type="xs:NMTOKEN" use="required"/>
<xs:attribute name="class" type="xs:string" use="required"/>
<xs:anyAttribute namespace="##other"/>
</xs:complexType>



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

Fixed, scheduled for 2.0.6





[DDC-1193] cascadeRemove misses associations due to proxy not being initialized Created: 03/Jun/11  Updated: 05/Jun/11  Resolved: 05/Jun/11

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

Type: Bug Priority: Major
Reporter: Illya Klymov Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None
Environment:

Linux x86_64


Attachments: File DDC1193Test.php    
Issue Links:
Dependency
depends on DDC-733 Implement a way of forcing a Persiste... Resolved

 Description   

Let's assume you have two One-to-One relations A>B>C (all include cascade remove). You are deleting object A, while object B is not initialized (and so it will be a proxy). In that case the object C is not deleted because UOW misses relation B>C since proxy of B is not initialized



 Comments   
Comment by Illya Klymov [ 03/Jun/11 ]

Test case. Expected to be put into Tests/ORM/Functional/Ticket folder

Comment by Illya Klymov [ 03/Jun/11 ]

Right now i'm using this hack inside of UOW:

diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php
index 90d3117..a4891c7 100644
--- a/lib/Doctrine/ORM/UnitOfWork.php
+++ b/lib/Doctrine/ORM/UnitOfWork.php
@@ -1702,7 +1702,10 @@ class UnitOfWork implements PropertyChangedListener
             if ( ! $assoc['isCascadeRemove']) {
                 continue;
             }
-            //TODO: If $entity instanceof Proxy => Initialize ?
+            if ($entity instanceof Proxy) {
+                // We need to initialize entity if we do not miss it's relations
+                $entity = clone($entity);
+            }
             $relatedEntities = $class->reflFields[$assoc['fieldName']]->getValue($entity);
             if ($relatedEntities instanceof Collection || is_array($relatedEntities)) {
                 // If its a PersistentCollection initialization is intended! No unwrap!
}}

As stated by beberlei IIRC, we should add public method to the generated proxy class "__doctrineInitializeProxy" or something

Comment by Benjamin Eberlei [ 05/Jun/11 ]

Fixed and merged into 2.0.x





[DDC-1192] fix undefined variable in join-column section of xml driver Created: 03/Jun/11  Updated: 05/Jun/11  Resolved: 05/Jun/11

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

Type: Bug Priority: Major
Reporter: Miha Vrhovnik Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

$name is undefined, It might be that the fix is as simple as foreach ($manyToOneElement->

{'join-columns'}->{'join-column'} as $name => $joinColumnElement) {
but I'm not sure


if (isset($manyToOneElement->{'join-column'})) {
$joinColumns[] = $this->_getJoinColumnMapping($manyToOneElement->{'join-column'});
} else if (isset($manyToOneElement->{'join-columns'}

)) {
foreach ($manyToOneElement->

{'join-columns'}

->

{'join-column'}

as $joinColumnElement) {
if (!isset($joinColumnElement['name']))

{ $joinColumnElement['name'] = $name; }

$joinColumns[] = $this->_getJoinColumnMapping($joinColumnElement);
}
}




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

This is a copy paste error from the YAML Driver, i fixed it.





[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 Fri Dec 19 18:19:16 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.