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

        Show
        Fabio B. Silva added a comment - Fixed by : https://github.com/doctrine/doctrine2/commit/cef20890dc75c11880827226e25f3fc6d5d66127
        Hide
        Fabio B. Silva added a comment -

        Hi Chris,

        Could you try to add a failing test case please ?

        Cheers.

        Show
        Fabio B. Silva added a comment - Hi Chris, Could you try to add a failing test case please ? Cheers.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: