Uploaded image for project: 'translate5'
  1. translate5
  2. TRANSLATE-910

Fast clicking on segment bookmark button leads to PHP error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • translate5 - 3.0.5
    • None
    • None

    Description

      When clicking very fast multiple times on the segment bookmark button the following error is triggered.
      Reason: the bookmark creation request is sent multiple times.
      Solution: Catch the "Duplicate entry" exception and ignore it / log it only in the PHP log.

      ZfExtended_Log on www.translate5.net - Kurzmeldung: exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '81860-

      {572ca5a6-1b74-4266-92bd-32874b2be70c}' for key 'segment_user'' in /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Db/Statement/Pdo.php:228
      Stack trace:
      #0 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
      #1 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Db/Statement.php(303): Zend_Db_Statement_Pdo->_execute(Array)
      #2 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
      #3 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `LE...', Array)
      #4 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Db/Adapter/Abstract.php(576): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `LE...', Array)
      #5 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Db/Table/Abstract.php(1076): Zend_Db_Adapter_Abstract->insert('LEK_segment_use...', Array)
      #6 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Db/Table/Row/Abstract.php(467): Zend_Db_Table_Abstract->insert(Array)
      #7 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Db/Table/Row/Abstract.php(438): Zend_Db_Table_Row_Abstract->_doInsert()
      #8 /webs/www.translate5.net/library/ZfExtended/Models/Entity/Abstract.php(253): Zend_Db_Table_Row_Abstract->save()
      #9 /webs/www.translate5.net/application/modules/editor/Controllers/SegmentuserassocController.php(59): ZfExtended_Models_Entity_Abstract->save()
      #10 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Controller/Action.php(516): Editor_SegmentuserassocController->postAction()
      #11 /webs/www.translate5.net/library/ZfExtended/Controllers/AAARestController.php(247): Zend_Controller_Action->dispatch('postAction')
      #12 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Controller/Dispatcher/Standard.php(308): ZfExtended_RestController->dispatch('postAction')
      #13 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(REST_Controller_Request_Http), Object(Zend_Controller_Response_Http))
      #14 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Application/Bootstrap/Bootstrap.php(101): Zend_Controller_Front->dispatch()
      #15 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
      #16 /webs/www.translate5.net/library/ZfExtended/BaseIndex.php(167): Zend_Application->run()
      #17 /webs/www.translate5.net/public/index.php(36): ZfExtended_BaseIndex->startApplication()
      #18 {main}

      Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '81860-{572ca5a6-1b74-4266-92bd-32874b2be70c}

      ' for key 'segment_user', query was: INSERT INTO `LEK_segment_user_assoc` (`segmentId`, `userGuid`, `taskGuid`, `created`, `modified`) VALUES (?, ?, ?, ?, ?)' in /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Db/Statement/Pdo.php:235
      Stack trace:
      #0 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Db/Statement.php(303): Zend_Db_Statement_Pdo->_execute(Array)
      #1 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
      #2 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `LE...', Array)
      #3 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Db/Adapter/Abstract.php(576): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `LE...', Array)
      #4 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Db/Table/Abstract.php(1076): Zend_Db_Adapter_Abstract->insert('LEK_segment_use...', Array)
      #5 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Db/Table/Row/Abstract.php(467): Zend_Db_Table_Abstract->insert(Array)
      #6 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Db/Table/Row/Abstract.php(438): Zend_Db_Table_Row_Abstract->_doInsert()
      #7 /webs/www.translate5.net/library/ZfExtended/Models/Entity/Abstract.php(253): Zend_Db_Table_Row_Abstract->save()
      #8 /webs/www.translate5.net/application/modules/editor/Controllers/SegmentuserassocController.php(59): ZfExtended_Models_Entity_Abstract->save()
      #9 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Controller/Action.php(516): Editor_SegmentuserassocController->postAction()
      #10 /webs/www.translate5.net/library/ZfExtended/Controllers/AAARestController.php(247): Zend_Controller_Action->dispatch('postAction')
      #11 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Controller/Dispatcher/Standard.php(308): ZfExtended_RestController->dispatch('postAction')
      #12 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(REST_Controller_Request_Http), Object(Zend_Controller_Response_Http))
      #13 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Application/Bootstrap/Bootstrap.php(101): Zend_Controller_Front->dispatch()
      #14 /webs/includes/ZendFramework-1.12.9-minimal/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
      #15 /webs/www.translate5.net/library/ZfExtended/BaseIndex.php(167): Zend_Application->run()
      #16 /webs/www.translate5.net/public/index.php(36): ZfExtended_BaseIndex->startApplication()
      #17

      {main}

      Attachments

        Activity

          People

            tlauria Thomas Lauria
            tlauria Thomas Lauria
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: