Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2311

ManyToManyPersister fails to delete when entity uses FK ID

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Git Master
    • Fix Version/s: 2.4
    • Component/s: ORM
    • Security Level: All
    • 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]];
      }
      

        Activity

        Chris Richard created issue -
        Chris Richard made changes -
        Field Original Value New Value
        Description ManyToManyPersister 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]];
                }
        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]];
        }
        Chris Richard made changes -
        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]];
        }
        ManyToManyPersister::getDeleteSQLParameters assumes $srcColumn contains a field name; doesn't handle association case.

        ManyToManyPerister.php, lines 204-209:
        {code}
        // Composite identifier
        $sourceClass = $this->_em->getClassMetadata($mapping['sourceEntity']);
        foreach ($mapping['relationToSourceKeyColumns'] as $relColumn => $srcColumn) {
           $params[] = $identifier[$sourceClass->fieldNames[$srcColumn]];
        }
        {code}
        Fabio B. Silva made changes -
        Assignee Benjamin Eberlei [ beberlei ] Fabio B. Silva [ fabio.bat.silva ]
        Fabio B. Silva made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.4 [ 10321 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Fabio B. Silva
            Reporter:
            Chris Richard
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: