CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Activity Mail DB Error: syntax error
Pages: [1]

Author Topic: Activity Mail DB Error: syntax error  (Read 1170 times)

ericross

  • I’m new here
  • *
  • Posts: 27
  • Karma: 0
  • civiadmin
    • National Day of Prayer New York
  • CiviCRM version: 4.6.2
  • CMS version: WordPress 4.1.1
  • MySQL version: 5.5.40-36.1
  • PHP version: 5.4.38
Activity Mail DB Error: syntax error
March 26, 2015, 07:12:24 am
Sending mail to a contact fails in 4.5.8.

The select statement fails when with @ in the email address.

Code: [Select]
SELECT contact_a.id as contact_id, contact_a.sort_name as `sort_name`, contact_a.display_name as `display_name`, contact_a.do_not_emailas `do_not_email`, contact_a.preferred_mail_format as `preferred_mail_format`, contact_a.is_deceased as `is_deceased`, civicrm_email.idas email_id, civicrm_email.email as `email`, civicrm_email.on_hold as `on_hold` FROM civicrm_contact contact_a LEFT JOIN civicrm_emailON (contact_a.id = civicrm_email.contact_id AND civicrm_email.is_primary = 1) WHERE ( ( contact_a.id IN(102,statecoordinators@ndpny.org ) ) ) LIMIT 0, 2
WHERE needs quotes around the email address.
Code: [Select]
SELECT contact_a.id as contact_id, contact_a.sort_name as `sort_name`, contact_a.display_name as `display_name`, contact_a.do_not_emailas `do_not_email`, contact_a.preferred_mail_format as `preferred_mail_format`, contact_a.is_deceased as `is_deceased`, civicrm_email.idas email_id, civicrm_email.email as `email`, civicrm_email.on_hold as `on_hold` FROM civicrm_contact contact_a LEFT JOIN civicrm_emailON (contact_a.id = civicrm_email.contact_id AND civicrm_email.is_primary = 1) WHERE ( ( contact_a.id IN(102,'statecoordinators@ndpny.org' ) ) ) LIMIT 0, 2
Code: [Select]
backTrace

#0 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(191): CRM_Core_Error::backtrace() #1 [internal function](): CRM_Core_Error::handle(Object(DB_Error)) #2 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error)) #3 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/packages/DB.php(975): PEAR_Error->PEAR_Error("DB Error: syntax error", -2, 16, (Array:2), "SELECT contact_a.id as contact_id, contact_a.sort_name  as `sort_name`, conta...") #4 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-2, 16, (Array:2), "SELECT contact_a.id as contact_id, contact_a.sort_name  as `sort_name`, conta...") #5 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -2, NULL, NULL, "SELECT contact_a.id as contact_id, contact_a.sort_name  as `sort_name`, conta...", "DB_Error", TRUE) #6 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(899): DB_common->raiseError(-2, NULL, NULL, NULL, "1064 ** You have an error in your SQL syntax; check the manual that correspon...") #7 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError() #8 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("SELECT contact_a.id as contact_id, contact_a.sort_name  as `sort_name`, conta...") #9 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2442): DB_common->query("SELECT contact_a.id as contact_id, contact_a.sort_name  as `sort_name`, conta...") #10 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1634): DB_DataObject->_query("SELECT contact_a.id as contact_id, contact_a.sort_name  as `sort_name`, conta...") #11 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(325): DB_DataObject->query("SELECT contact_a.id as contact_id, contact_a.sort_name  as `sort_name`, conta...") #12 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1116): CRM_Core_DAO->query("SELECT contact_a.id as contact_id, contact_a.sort_name  as `sort_name`, conta...", TRUE) #13 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(4427): CRM_Core_DAO::executeQuery("SELECT contact_a.id as contact_id, contact_a.sort_name  as `sort_name`, conta...") #14 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Token.php(1159): CRM_Contact_BAO_Query::apiQuery((Array:2), (Array:7), NULL, NULL, 0, 2) #15 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/Form/Task/EmailCommon.php(221): CRM_Utils_Token::getTokenDetails((Array:2), (Array:7), FALSE, FALSE) #16 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/Form/Task/Email.php(163): CRM_Contact_Form_Task_EmailCommon::buildQuickForm(Object(CRM_Contact_Form_Task_Email)) #17 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(455): CRM_Contact_Form_Task_Email->buildQuickForm() #18 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php(122): CRM_Core_Form->buildForm() #19 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Upload->perform(Object(CRM_Contact_Form_Task_Email), "upload") #20 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contact_Form_Task_Email), "upload") #21 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(356): HTML_QuickForm_Page->handle("upload") #22 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Wrapper.php(117): CRM_Core_Controller->run() #23 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(308): CRM_Utils_Wrapper->run("CRM_Contact_Form_Task_Email", "Activities", (Array:1)) #24 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(79): CRM_Core_Invoke::runItem((Array:14)) #25 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4)) #26 /home/ndpnyorg/public_html/wp-content/plugins/civicrm/civicrm.php(525): CRM_Core_Invoke::invoke((Array:4)) #27 [internal function](): CiviCRM_For_WordPress->invoke("") #28 /home/ndpnyorg/public_html/wp-includes/plugin.php(496): call_user_func_array((Array:2), (Array:1)) #29 /home/ndpnyorg/public_html/wp-admin/admin.php(212): do_action("toplevel_page_CiviCRM") #30 {main}
Usability Matters.

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Activity Mail DB Error: syntax error
March 26, 2015, 07:13:54 am
Eric,

Is this replicable on the demo database?  If so, this is a pretty serious bug and should be filed on issues.civicrm.org.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

ericross

  • I’m new here
  • *
  • Posts: 27
  • Karma: 0
  • civiadmin
    • National Day of Prayer New York
  • CiviCRM version: 4.6.2
  • CMS version: WordPress 4.1.1
  • MySQL version: 5.5.40-36.1
  • PHP version: 5.4.38
Re: Activity Mail DB Error: syntax error
March 26, 2015, 07:40:04 am
Works fine on the demo site.


My "Send an Email" dialog box doesn't populate the 'To' email address from the contact and I don't see the 'AddCC' and 'AddBCC' entries. Also, I have 'Send Email' at the top and bottom left. The demo site has it bottom only right.


It looks like the demo site is 4.5.9. Has that been released?
Usability Matters.

ericross

  • I’m new here
  • *
  • Posts: 27
  • Karma: 0
  • civiadmin
    • National Day of Prayer New York
  • CiviCRM version: 4.6.2
  • CMS version: WordPress 4.1.1
  • MySQL version: 5.5.40-36.1
  • PHP version: 5.4.38
Re: Activity Mail DB Error: syntax error caused by extension 'Email duration'
March 26, 2015, 07:51:50 am
I found that Email duration (com.uniqueadvisers.emailduration) was not tested with 4.5.8 and disabled it. That was the problem.
Usability Matters.

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Activity Mail DB Error: syntax error
March 26, 2015, 08:04:09 am
Aha!  I was going to say, I'm caught up on the issues queue and haven't seen any bugs relating to this screen since 4.5.8 was released - and the cc/bcc reminded me of an issue I saw once that dealt with a jQuery version mismatch.  Glad you found the issue!
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Activity Mail DB Error: syntax error

This forum was archived on 2017-11-26.