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) »
  • SQL Error on Contact Edit
Pages: [1]

Author Topic: SQL Error on Contact Edit  (Read 1820 times)

qjensen

  • I post frequently
  • ***
  • Posts: 141
  • Karma: 11
    • Scaled Solutions
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
SQL Error on Contact Edit
March 22, 2011, 10:02:27 am
When I try to edit a contact I am getting a SQL Syntax error. The following sql is being generated, which looks like a mashup of a couple of different sql statements

Code: [Select]
INSERT INTO dedupe (id1, id2, weight) SELECT 0 id1, 0 id2, 0 weight LIMIT 0 GROUP BY id1, id2 ON DUPLICATE KEY UPDATE weight = weight + VALUES(weight)
I looked at the code in CRM/Dedupe/BAO/RuleGroup.php where this sql statement is generated and it doesn't look like this sql statement could have come from that bit of code. I have emptied the civicrm cache folder and restarted apache to make sure that the APC cache wasn't storing something strange. Is there anything else I should try?

Here is the backtrace generated by the error:

Code: [Select]
/home/user/public_html/sites/all/modules/civicrm/packages/PEAR.php, call_user_func, 931
/home/user/public_html/sites/all/modules/civicrm/packages/DB.php, PEAR_Error, 968
/home/user/public_html/sites/all/modules/civicrm/packages/PEAR.php, DB_Error, 564
/home/user/public_html/sites/all/modules/civicrm/packages/DB/common.php, raiseError, 1903
/home/user/public_html/sites/all/modules/civicrm/packages/DB/mysql.php, raiseError, 898
/home/user/public_html/sites/all/modules/civicrm/packages/DB/mysql.php, mysqlRaiseError, 327
/home/user/public_html/sites/all/modules/civicrm/packages/DB/common.php, simpleQuery, 1216
/home/user/public_html/sites/all/modules/civicrm/packages/DB/DataObject.php, query, 2421
/home/user/public_html/sites/all/modules/civicrm/packages/DB/DataObject.php, _query, 1607
/home/user/public_html/sites/all/modules/civicrm/CRM/Core/DAO.php, query, 145
/home/user/public_html/sites/all/modules/civicrm/CRM/Dedupe/BAO/RuleGroup.php, query, 220
/home/user/public_html/sites/all/modules/civicrm/CRM/Dedupe/Finder.php, fillTable, 107
/home/user/public_html/sites/all/modules/civicrm/CRM/Contact/Form/Contact.php, dupesByParams, 1040
/home/user/public_html/sites/all/modules/civicrm/CRM/Contact/Form/Edit/Individual.php, checkDuplicateContacts, 135
, formRule,
/home/user/public_html/sites/all/modules/civicrm/packages/HTML/QuickForm.php, call_user_func, 1597
/home/user/public_html/sites/all/modules/civicrm/CRM/Core/Form.php, validate, 293
/home/user/public_html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php, validate, 137
/home/user/public_html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php, realPerform, 130
/home/user/public_html/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php, perform, 203
/home/user/public_html/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php, handle, 103
/home/user/public_html/sites/all/modules/civicrm/CRM/Core/Controller.php, handle, 284
/home/user/public_html/sites/all/modules/civicrm/CRM/Utils/Wrapper.php, run, 115
/home/user/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php, run, 191
/home/user/public_html/sites/all/modules/civicrm/drupal/civicrm.module, invoke, 355
, civicrm_invoke,
/home/user/public_html/includes/menu.inc, call_user_func_array, 348
/home/user/public_html/index.php, menu_execute_active_handler, 18
Quint Jensen
Web Developer
Scaled Solutions
--" Remove the 'I want you to like me' notes from your forehead and place them where they truly will do the most good -- on your mirror!" Author Unknown

qjensen

  • I post frequently
  • ***
  • Posts: 141
  • Karma: 11
    • Scaled Solutions
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: SQL Error on Contact Edit
March 22, 2011, 10:49:26 am
I found the problem. My client tried to create their own dedupe rule and then gave up. The dedupe rule had the Address Name field with the weight set to 0 and the weight threshold set to 0. Once I changed those values everything worked fine. I am going to do some additional testing and post a bug report.
Quint Jensen
Web Developer
Scaled Solutions
--" Remove the 'I want you to like me' notes from your forehead and place them where they truly will do the most good -- on your mirror!" Author Unknown

The Next Wave

  • I post occasionally
  • **
  • Posts: 111
  • Karma: -9
  • I'm just here to change the world.
  • CiviCRM version: 4.4.4
  • CMS version: Wordpress 3.8.1
  • MySQL version: 5.1.72-cll
  • PHP version: 5.4.25
Re: SQL Error on Contact Edit
June 08, 2013, 04:50:17 am
I was having a similar error- when people went to make a donation, it gave a db error-  before sending them to paypal.
I had made an unsupervised rule- to match voterID number in an import- thinking I was smart.
It was based on a field that voters wouldn't ever know.
However, when the donor tired to donate- it was giving syntax error.
It wasn't clear what the fields should contain- for length and weight- since it was the only rule I was using-
changing them to 7 for length and 1 for weight and changing it from unsupervised, to supervised- and then back to supervised seeemed to fix it.
There isn't a clear way to delete the rule.
Can some shed some light on what the length is supposed to do- and what the weight means?
Also- how to delete a rule?
And- why it's part of the process on creating a new record?
I don't see it in the process of creating a contribution form.
Thanks

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • SQL Error on Contact Edit

This forum was archived on 2017-11-26.