Doctrine 1
  1. Doctrine 1
  2. DC-397

unlinking of associations with aliased local-/foreignKeys is broken

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.1
    • Fix Version/s: 1.2.2
    • Component/s: Connection
    • Labels:
      None

      Description

      Doctrine_Connection_UnitOfWork->saveAssociations() does not use column-aliases for database-columns but only field-names. The following patch deals with this problem:

      Index: lib/Doctrine/Connection/UnitOfWork.php
      ===================================================================
      — lib/Doctrine/Connection/UnitOfWork.php (revision 7004)
      +++ lib/Doctrine/Connection/UnitOfWork.php (working copy)
      @@ -439,8 +439,8 @@
      $assocTable = $rel->getAssociationTable();
      foreach ($v->getDeleteDiff() as $r)

      { $query = 'DELETE FROM ' . $assocTable->getTableName() - . ' WHERE ' . $rel->getForeign() . ' = ?' - . ' AND ' . $rel->getLocal() . ' = ?'; + . ' WHERE ' . $rel->getForeignRefColumnName() . ' = ?' + . ' AND ' . $rel->getLocalRefColumnName() . ' = ?'; $this->conn->execute($query, array($r->getIncremented(), $record->getIncremented())); }

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Florian Klucke
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: