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 -
        Hide
        Fabio B. Silva added a comment -

        code format

        Show
        Fabio B. Silva added a comment - code format
        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 ]
        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
        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,

        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 -

        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.
        Ignacio Larranaga made changes -
        Attachment User.php [ 11200 ]
        Attachment Role.php [ 11201 ]
        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.
        Show
        Fabio B. Silva added a comment - Fixed by : https://github.com/doctrine/doctrine2/commit/4bfdcd32f7548c628fc393e36bf37ef8b97a80a8
        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 ]

        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-1885, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

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

            Dates

            • Created:
              Updated:
              Resolved: