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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Issues with Ubercart-CiviCRM Integration: DB Error: syntax error
Pages: [1] 2

Author Topic: Issues with Ubercart-CiviCRM Integration: DB Error: syntax error  (Read 8915 times)

dreadedhamish

  • I’m new here
  • *
  • Posts: 15
  • Karma: 1
  • CMS version: Drupal 7, Wordpress
Issues with Ubercart-CiviCRM Integration: DB Error: syntax error
July 12, 2013, 05:16:32 pm
I'm getting an error when trying to use "Ubercart-CiviCRM Integration".
The error is "DB Error: syntax error"


It's a new local install on MAMP:
Drupal 7.22
CiviCRM 4.3
7.x-3.5
Ubercart-CiviCRM Integration 7.x-1.1
PHP 5.3.14

In the log here is the error on install:
MESSAGE   Error updating contribution: Required fields not found for contribution contact_id
SEVERITY   error
HOSTNAME   ::1

What do I try next?
I'm normally a Wordpress user, and not that familiar with Drupal.
I've got sample data installed. I've tried un-enabling.  I've run the update script.  I've checked for updates.  I've run the update script.

Thanks in advance,
Hamish

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: Issues with Ubercart-CiviCRM Integration: DB Error: syntax error
July 12, 2013, 06:55:01 pm
Hi Hamish,

That module hasn't been updated for APIv3, and so is incompatible with Civi 4.3+.  It'll need updating before it works.  Other folks have had the same problem, but unfortunately none with funds to support someone porting it to APIv3   :(
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

dreadedhamish

  • I’m new here
  • *
  • Posts: 15
  • Karma: 1
  • CMS version: Drupal 7, Wordpress
Re: Issues with Ubercart-CiviCRM Integration: DB Error: syntax error
July 12, 2013, 07:36:09 pm
Ah, Okay. 

Can you see any issues running the same set up but with the 4.2.9 version of CiviCRM?

And I'm still new to the CiviCRM world, is there a page where I can pledge an amount towards to project?

Hamish

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: Issues with Ubercart-CiviCRM Integration: DB Error: syntax error
July 13, 2013, 04:11:00 pm
Hi Hamish,

I believe that the APIv2 is deprecated as of CiviCRM 3.2 - but that they didn't remove it until Civi 4.3.  I can't swear to it though, sorry.

As for pledging toward the project - are you referring to CiviCRM, or to the CiviCRM-Ubercart integration module?

To pledge to CiviCRM:
http://civicrm.org/participate/support-civicrm

If you're looking to fund the update of the Ubercart-CiviCRM module, I'd contact the author of the module, dharmatech: https://drupal.org/user/64968

If Dharmatech isn't interested in updating the module, a) you can post in the professional services forum on this site, and b) you can reply back to this ticket.  I'd have to talk to my coworkers, but I think we'd be willing to do this at a discount as part of our effort to keep the plugin ecosystem strong.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

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: Issues with Ubercart-CiviCRM Integration: DB Error: syntax error
July 13, 2013, 04:19:54 pm
This may be a bit more pie-in-the-sky, but it's also possible that Eileen's work here will render the need for this plugin irrelevant, since its functionality would be able to be handled via Rules and Views: https://github.com/eileenmcnaughton/civicrm_entity
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Issues with Ubercart-CiviCRM Integration: DB Error: syntax error
July 13, 2013, 04:29:54 pm
Note that although the v2 api folder was removed in 4.3 there is nothing stopping you from copying the v2 folder into your 4.3 install.

However, from the error you have reported  it's not clear that the absence of the v2 api is the immediate cause of the problem
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

dreadedhamish

  • I’m new here
  • *
  • Posts: 15
  • Karma: 1
  • CMS version: Drupal 7, Wordpress
Re: Issues with Ubercart-CiviCRM Integration: DB Error: syntax error
July 20, 2013, 06:55:56 am
Strangely i had the API v2 folder installed  - turns out it's not removed from 4.3.5.
Any other clues on what the problem could be? 

Can anyone report it working with 3.5+?
Or have other people not managed it either?

Re. contributing - I'd love it it civiCRM had a system like Make It Happen where anyone could post a job and take contributions.

dreadedhamish

  • I’m new here
  • *
  • Posts: 15
  • Karma: 1
  • CMS version: Drupal 7, Wordpress
Re: Issues with Ubercart-CiviCRM Integration: DB Error: syntax error
July 22, 2013, 02:16:06 am
Same error using 4.2.9 but nothing in the error log this time.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Issues with Ubercart-CiviCRM Integration: DB Error: syntax error
July 22, 2013, 06:08:44 pm
Quote
Re. contributing - I'd love it it civiCRM had a system like Make It Happen where anyone could post a job and take contributions.

I agree this would be nice. I would encourage you to try something like than KickStarter or similar & blog about it. The MIH system has it's strengths but that doesn't mean some experimention wouldn't be good.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

dreadedhamish

  • I’m new here
  • *
  • Posts: 15
  • Karma: 1
  • CMS version: Drupal 7, Wordpress
Re: Issues with Ubercart-CiviCRM Integration: DB Error: syntax error
July 26, 2013, 08:01:32 am
Can someone help me decrypt this?
Next steps?
I'm guessing #6 is the clue?

Hamish

#0 /home/bldsheep/public_html/esa/sites/all/modules/civicrm/CRM/Core/Error.php(148): CRM_Core_Error::backtrace()
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /home/bldsheep/public_html/esa/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /home/bldsheep/public_html/esa/sites/all/modules/civicrm/packages/DB.php(968): PEAR_Error->PEAR_Error("DB Error: syntax error", -2, 16, (Array:2), "SELECT id, name FROM {civicrm_contribution_type} WHERE is_active = 1 [nativec...")
#4 /home/bldsheep/public_html/esa/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-2, 16, (Array:2), "SELECT id, name FROM {civicrm_contribution_type} WHERE is_active = 1 [nativec...")
#5 /home/bldsheep/public_html/esa/sites/all/modules/civicrm/packages/DB/common.php(1903): PEAR->raiseError(NULL, -2, NULL, NULL, "SELECT id, name FROM {civicrm_contribution_type} WHERE is_active = 1 [nativec...", "DB_Error", TRUE)
#6 /home/bldsheep/public_html/esa/sites/all/modules/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 /home/bldsheep/public_html/esa/sites/all/modules/civicrm/packages/DB/mysql.php(327): DB_mysql->mysqlRaiseError()
#8 /home/bldsheep/public_html/esa/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("SELECT id, name FROM {civicrm_contribution_type} WHERE is_active = 1")
#9 /home/bldsheep/public_html/esa/sites/all/modules/civicrm/packages/DB/DataObject.php(2421): DB_common->query("SELECT id, name FROM {civicrm_contribution_type} WHERE is_active = 1")
#10 /home/bldsheep/public_html/esa/sites/all/modules/civicrm/packages/DB/DataObject.php(1613): DB_DataObject->_query("SELECT id, name FROM {civicrm_contribution_type} WHERE is_active = 1")
#11 /home/bldsheep/public_html/esa/sites/all/modules/civicrm/CRM/Core/DAO.php(155): DB_DataObject->query("SELECT id, name FROM {civicrm_contribution_type} WHERE is_active = 1")
#12 /home/bldsheep/public_html/esa/sites/all/modules/civicrm/CRM/Core/DAO.php(922): CRM_Core_DAO->query("SELECT id, name FROM {civicrm_contribution_type} WHERE is_active = 1", TRUE)
#13 /home/bldsheep/public_html/esa/sites/all/modules/uc_civicrm/uc_civicrm.module(107): CRM_Core_DAO::executeQuery("SELECT id, name FROM {civicrm_contribution_type} WHERE is_active = 1", (Array:0))
#14 [internal function](): uc_civicrm_admin((Array:0), (Array:13))
#15 /home/bldsheep/public_html/esa/includes/form.inc(798): call_user_func_array("uc_civicrm_admin", (Array:2))
#16 /home/bldsheep/public_html/esa/includes/form.inc(339): drupal_retrieve_form("uc_civicrm_admin", (Array:13))
#17 /home/bldsheep/public_html/esa/includes/form.inc(131): drupal_build_form("uc_civicrm_admin", (Array:13))
#18 [internal function](): drupal_get_form("uc_civicrm_admin")
#19 /home/bldsheep/public_html/esa/includes/menu.inc(517): call_user_func_array("drupal_get_form", (Array:1))
#20 /home/bldsheep/public_html/esa/index.php(21): menu_execute_active_handler()
#21 {main}

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Issues with Ubercart-CiviCRM Integration: DB Error: syntax error
July 26, 2013, 08:08:48 am

the sql query is wrong. Seems like its using drupal conventions rather than civi conventions. You'll need to modify the code to fix this and other queries

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Issues with Ubercart-CiviCRM Integration: DB Error: syntax error
July 26, 2013, 03:06:49 pm
 {civicrm_contribution_type}  is a drupal convention which civicrm doesnt recognise
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

dreadedhamish

  • I’m new here
  • *
  • Posts: 15
  • Karma: 1
  • CMS version: Drupal 7, Wordpress
Re: Issues with Ubercart-CiviCRM Integration: DB Error: syntax error
July 26, 2013, 08:12:10 pm
So if others are using this without this issue, what could I have done to stuff it up? (assume I can and will make all the rookie mistakes).
 

dreadedhamish

  • I’m new here
  • *
  • Posts: 15
  • Karma: 1
  • CMS version: Drupal 7, Wordpress
Re: Issues with Ubercart-CiviCRM Integration: DB Error: syntax error
July 27, 2013, 12:44:39 am
Here is the query in the module:

Code: [Select]
// Get contribution types
  $sql = "SELECT id, name FROM {civicrm_contribution_type} WHERE is_active = 1";
  $dao =& CRM_Core_DAO::executeQuery($sql, array());
  $types = array(0 => "Select a type...");
  while ($dao->fetch()) { $types[$dao->id] = $dao->name; }

Removing the curly brackets has gotten me a step further using 4.2.9.  The page now renders as it should but I haven't tried actually using it yet. I'm nervous about editing code when I seem the only one having the issue.
« Last Edit: July 27, 2013, 05:18:43 am by hes21 »

dreadedhamish

  • I’m new here
  • *
  • Posts: 15
  • Karma: 1
  • CMS version: Drupal 7, Wordpress
Re: Issues with Ubercart-CiviCRM Integration: DB Error: syntax error
August 04, 2013, 08:43:38 pm
I'm giving up.  I got further with Commerce but with the upcoming release of 4.4, and from what colemanw has said about Webform-civicrm integration and new abilities to make payments for events, that seems a better solution that lets me use the latest version of everything.

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Issues with Ubercart-CiviCRM Integration: DB Error: syntax error

This forum was archived on 2017-11-26.