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

        Ignacio Larranaga created issue -
        Fabio B. Silva made changes -
        Field Original Value New Value
        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;
                }
        delete($entity) from BasicEntityPersiter is not considering that the columns might be quoted.

        {code}
        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);
        }
        {code}

        The third line:
        {code}
                $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;
                }
        {code}
        Fabio B. Silva made changes -
        Assignee Benjamin Eberlei [ beberlei ] Fabio B. Silva [ fabio.bat.silva ]
        Ignacio Larranaga made changes -
        Attachment User.php [ 11200 ]
        Attachment Role.php [ 11201 ]
        Fabio B. Silva made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.3 [ 10185 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 13792 ] jira-feedback [ 15391 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 15391 ] jira-feedback2 [ 17255 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 17255 ] jira-feedback3 [ 19511 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: