[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


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]];

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

Hi Chris,

Could you try to add a failing test case please ?


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

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

Generated at Fri Sep 04 04:11:20 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.