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 »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • error after upgrading to civicrm 4.52
Pages: [1]

Author Topic: error after upgrading to civicrm 4.52  (Read 568 times)

mudnik

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 0
  • CiviCRM version: 4.5.3
  • CMS version: drupal
  • MySQL version: 5.5.34-cll
  • PHP version: 5.4.23
error after upgrading to civicrm 4.52
November 02, 2014, 08:36:57 pm
Hi,

I get an error message when I try to click on a user after I upgraded from 4.4x to 4.52. 

http://www.xxx.com/users/abcname

Sorry but we are not able to provide this at the moment.
DB Error: syntax error

Can anyone help?

This is the stack error logs:

$Fatal Error Details = Array ( [callback] => Array (
  • => CRM_Core_Error [1] => handle )
    Code: [Select]
    => -2 [message] => DB Error: syntax error [mode] => 16 [debug_info] => SELECT contact_a.id as contact_id, contact_a.prefix_id as `prefix_id`, contact_a.first_name as `first_name`, contact_a.last_name as `last_name`, contact_a.job_title as `job_title`, `1-location_type`.id as `1-location_type_id`, `1-location_type`.name as `1-location_type`, `1-phone-2`.id as `1-phone-2_id`, `1-phone-2`.phone as `1-phone-2`, `1-address`.id as `1-address_id`, `1-address`.street_address as `1-street_address`, `1-address`.supplemental_address_1 as `1-supplemental_address_1`, `1-address`.postal_code as `1-postal_code`, `1-address`.city as `1-city`, `1-address`.country_id as `1-country_id`, `website--url`.id as `website--url_id`, `website--url`.url as `website--url`, `website--url`.website_type_id as `website--website_type_id` FROM civicrm_contact contact_a LEFT JOIN civicrm_address `1-address` ON (`1-address`.contact_id = contact_a.id AND `1-address`.is_primary = 1) LEFT JOIN civicrm_phone `1-phone-2` ON contact_a.id = `1-phone-2`.contact_id AND `1-phone-2`.is_primary = 1 LEFT JOIN civicrm_location_type `1-location_type` ON ( ( `1-phone-2`.location_type_id = `1-location_type`.id )OR ( `1-address`.location_type_id = `1-location_type`.id ) ) LEFT JOIN civicrm_website `website--url` ON (`website--url`.contact_id = contact_a.id AND `website--url`.website_type_id = ) WHERE ( contact_a.id = '5114' ) AND (contact_a.is_deleted = 0) ORDER BY contact_a.sort_name asc, contact_a.id [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') WHERE ( contact_a.id = '5114' ) AND (contact_a.is_deleted = 0) ORDER BY ' at line 5] [type] => DB_Error [user_info] => SELECT contact_a.id as contact_id, contact_a.prefix_id as `prefix_id`, contact_a.first_name as `first_name`, contact_a.last_name as `last_name`, contact_a.job_title as `job_title`, `1-location_type`.id as `1-location_type_id`, `1-location_type`.name as `1-location_type`, `1-phone-2`.id as `1-phone-2_id`, `1-phone-2`.phone as `1-phone-2`, `1-address`.id as `1-address_id`, `1-address`.street_address as `1-street_address`, `1-address`.supplemental_address_1 as `1-supplemental_address_1`, `1-address`.postal_code as `1-postal_code`, `1-address`.city as `1-city`, `1-address`.country_id as `1-country_id`, `website--url`.id as `website--url_id`, `website--url`.url as `website--url`, `website--url`.website_type_id as `website--website_type_id` FROM civicrm_contact contact_a LEFT JOIN civicrm_address `1-address` ON (`1-address`.contact_id = contact_a.id AND `1-address`.is_primary = 1) LEFT JOIN civicrm_phone `1-phone-2` ON contact_a.id = `1-phone-2`.contact_id AND `1-phone-2`.is_primary = 1 LEFT JOIN civicrm_location_type `1-location_type` ON ( ( `1-phone-2`.location_type_id = `1-location_type`.id )OR ( `1-address`.location_type_id = `1-location_type`.id ) ) LEFT JOIN civicrm_website `website--url` ON (`website--url`.contact_id = contact_a.id AND `website--url`.website_type_id = ) WHERE ( contact_a.id = '5114' ) AND (contact_a.is_deleted = 0) ORDER BY contact_a.sort_name asc, contact_a.id [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') WHERE ( contact_a.id = '5114' ) AND (contact_a.is_deleted = 0) ORDER BY ' at line 5] [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT contact_a.id as contact_id, contact_a.prefix_id as `prefix_id`, contact_a.first_name as `first_name`, contact_a.last_name as `last_name`, contact_a.job_title as `job_title`, `1-location_type`.id as `1-location_type_id`, `1-location_type`.name as `1-location_type`, `1-phone-2`.id as `1-phone-2_id`, `1-phone-2`.phone as `1-phone-2`, `1-address`.id as `1-address_id`, `1-address`.street_address as `1-street_address`, `1-address`.supplemental_address_1 as `1-supplemental_address_1`, `1-address`.postal_code as `1-postal_code`, `1-address`.city as `1-city`, `1-address`.country_id as `1-country_id`, `website--url`.id as `website--url_id`, `website--url`.url as `website--url`, `website--url`.website_type_id as `website--website_type_id` FROM civicrm_contact contact_a LEFT JOIN civicrm_address `1-address` ON (`1-address`.contact_id = contact_a.id AND `1-address`.is_primary = 1) LEFT JOIN civicrm_phone `1-phone-2` ON contact_a.id = `1-phone-2`.contact_id AND `1-phone-2`.is_primary = 1 LEFT JOIN civicrm_location_type `1-location_type` ON ( ( `1-phone-2`.location_type_id = `1-location_type`.id )OR ( `1-address`.location_type_id = `1-location_type`.id ) ) LEFT JOIN civicrm_website `website--url` ON (`website--url`.contact_id = contact_a.id AND `website--url`.website_type_id = ) WHERE ( contact_a.id = '5114' ) AND (contact_a.is_deleted = 0) ORDER BY contact_a.sort_name asc, contact_a.id [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') WHERE ( contact_a.id = '5114' ) AND (contact_a.is_deleted = 0) ORDER BY ' at line 5]"] )

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: error after upgrading to civicrm 4.52
November 03, 2014, 03:25:21 am
Here is your SQL formatted more clearly:

Code: [Select]
SELECT contact_a.id AS contact_id,
       contact_a.prefix_id AS `prefix_id`,
       contact_a.first_name AS `first_name`,
       contact_a.last_name AS `last_name`,
       contact_a.job_title AS `job_title`,
       `1-location_type`.id AS `1-location_type_id`,
       `1-location_type`.name AS `1-location_type`,
       `1-phone-2`.id AS `1-phone-2_id`,
       `1-phone-2`.phone AS `1-phone-2`,
       `1-address`.id AS `1-address_id`,
       `1-address`.street_address AS `1-street_address`,
       `1-address`.supplemental_address_1 AS `1-supplemental_address_1`,
       `1-address`.postal_code AS `1-postal_code`,
       `1-address`.city AS `1-city`,
       `1-address`.country_id AS `1-country_id`,
       `website--url`.id AS `website--url_id`,
       `website--url`.url AS `website--url`,
       `website--url`.website_type_id AS `website--website_type_id`
FROM civicrm_contact contact_a
LEFT JOIN civicrm_address `1-address` ON (`1-address`.contact_id = contact_a.id
                                          AND `1-address`.is_primary = 1)
LEFT JOIN civicrm_phone `1-phone-2` ON contact_a.id = `1-phone-2`.contact_id
AND `1-phone-2`.is_primary = 1
LEFT JOIN civicrm_location_type `1-location_type` ON ((`1-phone-2`.location_type_id = `1-location_type`.id)
                                                      OR (`1-address`.location_type_id = `1-location_type`.id))
LEFT JOIN civicrm_website `website--url` ON (`website--url`.contact_id = contact_a.id
                                             AND `website--url`.website_type_id =)
WHERE (contact_a.id = '5114')
  AND (contact_a.is_deleted = 0)
ORDER BY contact_a.sort_name ASC,
         contact_a.id

The issue is AND `website--url`.website_type_id =) just before the WHERE clause. The value for website_type_id is missing.

Not sure why however. :(
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

mudnik

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 0
  • CiviCRM version: 4.5.3
  • CMS version: drupal
  • MySQL version: 5.5.34-cll
  • PHP version: 5.4.23
Re: error after upgrading to civicrm 4.52
November 03, 2014, 07:04:19 pm
Thanks Hershel!

That helps a lot.

I disabled the website field on the user profile and it loads fine already.

Not the best way to solve this but can do without that field.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • error after upgrading to civicrm 4.52

This forum was archived on 2017-11-26.