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}
        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.
        Fabio B. Silva made changes -
        Assignee Benjamin Eberlei [ beberlei ] Fabio B. Silva [ fabio.bat.silva ]
        Show
        Fabio B. Silva added a comment - Fixed by : https://github.com/doctrine/doctrine2/commit/cef20890dc75c11880827226e25f3fc6d5d66127
        Fabio B. Silva made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.4 [ 10321 ]
        Resolution Fixed [ 1 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-2311, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

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

            Dates

            • Created:
              Updated:
              Resolved: