Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1885

Problem with column quoting on Delete

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.6
    • Fix Version/s: 2.3
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      delete($entity) from BasicEntityPersiter is not considering that the columns might be quoted.

      public function delete($entity) {
      	$identifier = $this->_em->getUnitOfWork()->getEntityIdentifier($entity);
              $this->deleteJoinTableRecords($identifier);
      
              $id = array_combine($this->_class->getIdentifierColumnNames(), $identifier);
              $this->_conn->delete($this->_class->getQuotedTableName($this->_platform), $id);
      }
      

      The third line:

              $id = array_combine($this->_class->getIdentifierColumnNames(), $identifier);
              // might be fixed in this way (as example):
              foreach ($identifier as $columnName => $value) {
                      $id[$this->_class->getQuotedColumnName($columnName, $this->_platform)] = $value;
              }
      
      1. Role.php
        2 kB
        Ignacio Larranaga
      2. User.php
        4 kB
        Ignacio Larranaga

        Activity

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

        Thanks Ignacio,

        I'm working on this problem.

        Show
        Fabio B. Silva added a comment - Thanks Ignacio, I'm working on this problem.
        Hide
        Ignacio Larranaga added a comment -

        User and Role, and I was just adding a role and updateing.
        The database is PostgresSQL.

        Show
        Ignacio Larranaga added a comment - User and Role, and I was just adding a role and updateing. The database is PostgresSQL.
        Hide
        Fabio B. Silva added a comment -

        Hi Ignacio,

        No problem, could you attach your entities ?

        Thanks

        Show
        Fabio B. Silva added a comment - Hi Ignacio, No problem, could you attach your entities ? Thanks
        Hide
        Ignacio Larranaga added a comment -

        Hi Fabio, sorry I doesn't have a test case written

        Show
        Ignacio Larranaga added a comment - Hi Fabio, sorry I doesn't have a test case written
        Hide
        Fabio B. Silva added a comment -

        Hi Ignacio,

        I think it will be fixed by :
        https://github.com/doctrine/doctrine2/pull/372

        Anyway could you attach a test case for this one please ?

        Show
        Fabio B. Silva added a comment - Hi Ignacio, I think it will be fixed by : https://github.com/doctrine/doctrine2/pull/372 Anyway could you attach a test case for this one please ?
        Hide
        Fabio B. Silva added a comment -

        code format

        Show
        Fabio B. Silva added a comment - code format

          People

          • Assignee:
            Fabio B. Silva
            Reporter:
            Ignacio Larranaga
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: