Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-11986

Back-office event registration with price set fails with fatal error - Database Error Code: Duplicate entry 'civicrm_participant-53-22-10' for key 'UI_line_item_value'

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Critical
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.3.0
    • Fix Version/s: 4.3.0
    • Labels:
      None

      Description

      Saving a back-office event registration () for an event that has a non-quick-config price set with > 1 price field throws a fatal error:
      Database Error Code: Duplicate entry 'civicrm_participant-53-22-10' for key 'UI_line_item_value', 1062

      Backtrace below, but looks like it's trying to write the first line_item to the DB twice. I've attached a screenshot of the form inputs. When I look at the DB, the first of the two expected line_item rows has been inserted, and the query that fails is trying to insert the same values again.

      INSERT INTO civicrm_line_item (entity_table , entity_id , price_field_id , label , qty , unit_price , line_total , participant_count , price_field_value_id , financial_type_id ) VALUES ('civicrm_participant' , 53 , 10 , 'Regular Fee' , 1 , 150 , 150 , 0 , 22 , 1 ) [nativecode=1062 ** Duplicate entry 'civicrm_participant-53-22-10' for key 'UI_line_item_value']

      NOTE: This is the same price set i've been using for the accounting batch export and the bookkeeping report bugs. Two price fields with price values having different Financial Types.

      =========
      /Users/dgg/svn/crm_v4.3/CRM/Core/Error.php(148): CRM_Core_Error::backtrace()
      #1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
      #2 /Users/dgg/svn/crm_v4.3/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
      #3 /Users/dgg/svn/crm_v4.3/packages/DB.php(969): PEAR_Error->PEAR_Error("DB Error: already exists", -5, 16, (Array:2), "INSERT INTO civicrm_line_item (entity_table , entity_id , price_field_id , la...")
      #4 /Users/dgg/svn/crm_v4.3/packages/PEAR.php(564): DB_Error->DB_Error(-5, 16, (Array:2), "INSERT INTO civicrm_line_item (entity_table , entity_id , price_field_id , la...")
      #5 /Users/dgg/svn/crm_v4.3/packages/DB/common.php(1905): PEAR->raiseError(NULL, -5, NULL, NULL, "INSERT INTO civicrm_line_item (entity_table , entity_id , price_field_id , la...", "DB_Error", TRUE)
      #6 /Users/dgg/svn/crm_v4.3/packages/DB/mysql.php(898): DB_common->raiseError(-5, NULL, NULL, NULL, "1062 ** Duplicate entry 'civicrm_participant-53-22-10' for key 'UI_line_item_...")
      #7 /Users/dgg/svn/crm_v4.3/packages/DB/mysql.php(327): DB_mysql->mysqlRaiseError()
      #8 /Users/dgg/svn/crm_v4.3/packages/DB/common.php(1216): DB_mysql->simpleQuery("INSERT INTO civicrm_line_item (entity_table , entity_id , price_field_id , la...")
      #9 /Users/dgg/svn/crm_v4.3/packages/DB/DataObject.php(2421): DB_common->query("INSERT INTO civicrm_line_item (entity_table , entity_id , price_field_id , la...")
      #10 /Users/dgg/svn/crm_v4.3/packages/DB/DataObject.php(1055): DB_DataObject->_query("INSERT INTO civicrm_line_item (entity_table , entity_id , price_field_id , la...")
      #11 /Users/dgg/svn/crm_v4.3/CRM/Core/DAO.php(287): DB_DataObject->insert()
      #12 /Users/dgg/svn/crm_v4.3/CRM/Price/BAO/LineItem.php(65): CRM_Core_DAO->save()
      #13 /Users/dgg/svn/crm_v4.3/CRM/Price/BAO/LineItem.php(291): CRM_Price_BAO_LineItem::create((Array:17))
      #14 /Users/dgg/svn/crm_v4.3/CRM/Event/Form/Participant.php(1491): CRM_Price_BAO_LineItem::processPriceSet(53, (Array:2), Object(CRM_Contribute_BAO_Contribution), "civicrm_participant")
      #15 /Users/dgg/svn/crm_v4.3/CRM/Core/Form.php(246): CRM_Event_Form_Participant->postProcess()
      #16 /Users/dgg/svn/crm_v4.3/CRM/Core/QuickForm/Action/Upload.php(151): CRM_Core_Form->mainProcess()
      #17 /Users/dgg/svn/crm_v4.3/CRM/Core/QuickForm/Action/Upload.php(128): CRM_Core_QuickForm_Action_Upload->realPerform(Object(CRM_Event_Form_Participant), "upload")
      #18 /Users/dgg/svn/crm_v4.3/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Upload->perform(Object(CRM_Event_Form_Participant), "upload")
      #19 /Users/dgg/svn/crm_v4.3/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Event_Form_Participant), "upload")
      #20 /Users/dgg/svn/crm_v4.3/CRM/Core/Controller.php(316): HTML_QuickForm_Page->handle("upload")
      #21 /Users/dgg/svn/crm_v4.3/CRM/Event/Page/Tab.php(115): CRM_Core_Controller->run()
      #22 /Users/dgg/svn/crm_v4.3/CRM/Event/Page/Tab.php(183): CRM_Event_Page_Tab->edit()
      #23 /Users/dgg/svn/crm_v4.3/CRM/Core/Invoke.php(292): CRM_Event_Page_Tab->run((Array:4), NULL)
      #24 /Users/dgg/svn/crm_v4.3/CRM/Core/Invoke.php(70): CRM_Core_Invoke::runItem((Array:12))
      #25 /Users/dgg/svn/crm_v4.3/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
      #26 /Users/dgg/svn/crm_v4.3/drupal/civicrm.module(407): CRM_Core_Invoke::invoke((Array:4))
      #27 [internal function](): civicrm_invoke("contact", "view", "participant")
      #28 /Users/dgg/htdocs/drupal7/includes/menu.inc(516): call_user_func_array("civicrm_invoke", (Array:3))
      #29 /Users/dgg/htdocs/drupal7/index.php(21): menu_execute_active_handler()
      #30

      {main}

        Attachments

          Activity

            People

            • Assignee:
              dgg David Greenberg
              Reporter:
              dgg David Greenberg
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: