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

Error on deleting message templates

    Details

      Description

      This was tested with 4.3Beta5 and WP, as well as the WP demo site.

      To reproduce:
      1. Goto Administer/ Communications/ Message Templates
      2. Click "Add Message Template" to create a new custom template
      3. Enter values into Message Title and Subject, as well as Plain and HTML format
      4. Click save
      5. At the listing of message templates click to delete the newly created template
      6. When prompted to delete, click yes.
      7. DB error occurs:

      #0 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(148): CRM_Core_Error::backtrace()
      #1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
      #2 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
      #3 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/packages/DB.php(969): PEAR_Error->PEAR_Error("DB Error: syntax error", -2, 16, (Array:2), "UPDATE civicrm_mailing\n SET msg_template_id = NULL\n ...")
      #4 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-2, 16, (Array:2), "UPDATE civicrm_mailing\n SET msg_template_id = NULL\n ...")
      #5 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -2, NULL, NULL, "UPDATE civicrm_mailing\n SET msg_template_id = NULL\n ...", "DB_Error", TRUE)
      #6 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(898): DB_common->raiseError(-2, NULL, NULL, NULL, "1064 ** You have an error in your SQL syntax; check the manual that correspon...")
      #7 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(327): DB_mysql->mysqlRaiseError()
      #8 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("UPDATE civicrm_mailing\n SET msg_template_id = NULL\n ...")
      #9 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2421): DB_common->query("UPDATE civicrm_mailing\n SET msg_template_id = NULL\n ...")
      #10 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1613): DB_DataObject->_query("UPDATE civicrm_mailing\n SET msg_template_id = NULL\n ...")
      #11 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(155): DB_DataObject->query("UPDATE civicrm_mailing\n SET msg_template_id = NULL\n ...")
      #12 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(917): CRM_Core_DAO->query("UPDATE civicrm_mailing\n SET msg_template_id = NULL\n ...", TRUE)
      #13 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/MessageTemplates.php(114): CRM_Core_DAO::executeQuery("UPDATE civicrm_mailing\n SET msg_template_id = NULL\n ...", NULL)
      #14 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Admin/Form/MessageTemplates.php(236): CRM_Core_BAO_MessageTemplates::del("58")
      #15 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(246): CRM_Admin_Form_MessageTemplates->postProcess()
      #16 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php(160): CRM_Core_Form->mainProcess()
      #17 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php(60): CRM_Core_StateMachine->perform(Object(CRM_Admin_Form_MessageTemplates), "next", "Next")
      #18 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Admin_Form_MessageTemplates), "next")
      #19 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_MessageTemplates), "next")
      #20 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(316): HTML_QuickForm_Page->handle("next")
      #21 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php(374): CRM_Core_Controller->run()
      #22 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php(178): CRM_Core_Page_Basic->edit(8, "58")
      #23 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Admin/Page/MessageTemplates.php(181): CRM_Core_Page_Basic->run((Array:3), NULL, NULL)
      #24 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(292): CRM_Admin_Page_MessageTemplates->run((Array:3), NULL)
      #25 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(70): CRM_Core_Invoke::runItem((Array:13))
      #26 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
      #27 /var/www/vhosts/tmai.org/httpdocs/wp-content/plugins/civicrm/civicrm.php(329): CRM_Core_Invoke::invoke((Array:3))
      #28 [internal function](): civicrm_wp_invoke("")
      #29 /var/www/vhosts/tmai.org/httpdocs/wp-includes/plugin.php(406): call_user_func_array("civicrm_wp_invoke", (Array:1))
      #30 /var/www/vhosts/tmai.org/httpdocs/wp-admin/admin.php(151): do_action("toplevel_page_CiviCRM")
      #31

      {main}

        Attachments

          Activity

            People

            • Assignee:
              yashodha Yashodha Chaku
              Reporter:
              tmai Thomas Hochstetter
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: