[DDC-2311] ManyToManyPersister fails to delete when entity uses FK ID Created: 21/Feb/13  Updated: 16/Apr/13  Resolved: 16/Apr/13

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

Type: Bug Priority: Major
Reporter: Chris Richard Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None


 Description   

ManyToManyPersister::getDeleteSQLParameters assumes $srcColumn contains a field name; doesn't handle association case.

ManyToManyPerister.php, lines 204-209:

// Composite identifier
$sourceClass = $this->_em->getClassMetadata($mapping['sourceEntity']);
foreach ($mapping['relationToSourceKeyColumns'] as $relColumn => $srcColumn) {
   $params[] = $identifier[$sourceClass->fieldNames[$srcColumn]];
}


 Comments   
Comment by Fabio B. Silva [ 21/Feb/13 ]

Hi Chris,

Could you try to add a failing test case please ?

Cheers.

Comment by Fabio B. Silva [ 16/Apr/13 ]

Fixed by : https://github.com/doctrine/doctrine2/commit/cef20890dc75c11880827226e25f3fc6d5d66127

Generated at Tue Oct 21 12:05:05 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.