Details
-
Type:
Bug
-
Status: Done/Fixed
-
Priority:
Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 1.7
-
Fix Version/s: 1.8
-
Component/s: None
-
Labels:None
Description
Since we upgrade our CiviCRM to 1.7, we see SQL errors when users select certain groups. I'm not really sure, but I think it might be related to uncomplete escaping of the brackets in the names. Suggestions for a fix for this problem would be very appreciated.
Luc
A backtrace:
Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => handle
)
[code] => -2
[message] => DB Error: syntax error
[mode] => 16
[debug_info] => SELECT
civicrm_group_contact.id as civicrm_group_contact_id,
civicrm_group.title as group_title,
civicrm_group.visibility as visibility,
civicrm_group_contact.status as status,
civicrm_group.id as group_id,
civicrm_subscription_history.date as date,
civicrm_subscription_history.method as method FROM civicrm_contact contact_a LEFT JOIN civicrm_group_contact ON contact_a.id = civicrm_group_contact.contact_id LEFT JOIN civicrm_group ON civicrm_group.id = civicrm_group_contact.group_id LEFT JOIN civicrm_subscription_history
ON civicrm_group_contact.contact_id = civicrm_subscription_history.contact_id
AND civicrm_group_contact.group_id = civicrm_subscription_history.group_id WHERE contact_a.id = 9686 AND civicrm_group.is_active = 1 AND civicrm_group_contact.status = 'Added' AND ( ( civicrm_group_contact.group_id IN (Actieve leden, Leden, Perscontacten, PUB - Telenet klanten, PUB nieuwsbrief (Telenet klanten), STUG - Scarlet klanten, STUG nieuwsbrief (Scarlet klanten), Zakelijke gebruikers ) AND civicrm_group_contact.status = 'Added' ) ) ORDER BY civicrm_group.title [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 'leden, Leden, Perscontacten, PUB - Telenet klanten, PUB nieuwsbrief (Telenet kla' at line 10]
[type] => DB_Error
[user_info] => SELECT
civicrm_group_contact.id as civicrm_group_contact_id,
civicrm_group.title as group_title,
civicrm_group.visibility as visibility,
civicrm_group_contact.status as status,
civicrm_group.id as group_id,
civicrm_subscription_history.date as date,
civicrm_subscription_history.method as method FROM civicrm_contact contact_a LEFT JOIN civicrm_group_contact ON contact_a.id = civicrm_group_contact.contact_id LEFT JOIN civicrm_group ON civicrm_group.id = civicrm_group_contact.group_id LEFT JOIN civicrm_subscription_history
ON civicrm_group_contact.contact_id = civicrm_subscription_history.contact_id
AND civicrm_group_contact.group_id = civicrm_subscription_history.group_id WHERE contact_a.id = 9686 AND civicrm_group.is_active = 1 AND civicrm_group_contact.status = 'Added' AND ( ( civicrm_group_contact.group_id IN (Actieve leden, Leden, Perscontacten, PUB - Telenet klanten, PUB nieuwsbrief (Telenet klanten), STUG - Scarlet klanten, STUG nieuwsbrief (Scarlet klanten), Zakelijke gebruikers ) AND civicrm_group_contact.status = 'Added' ) ) ORDER BY civicrm_group.title [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 'leden, Leden, Perscontacten, PUB - Telenet klanten, PUB nieuwsbrief (Telenet kla' at line 10]
[to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT
civicrm_group_contact.id as civicrm_group_contact_id,
civicrm_group.title as group_title,
civicrm_group.visibility as visibility,
civicrm_group_contact.status as status,
civicrm_group.id as group_id,
civicrm_subscription_history.date as date,
civicrm_subscription_history.method as method FROM civicrm_contact contact_a LEFT JOIN civicrm_group_contact ON contact_a.id = civicrm_group_contact.contact_id LEFT JOIN civicrm_group ON civicrm_group.id = civicrm_group_contact.group_id LEFT JOIN civicrm_subscription_history
ON civicrm_group_contact.contact_id = civicrm_subscription_history.contact_id
AND civicrm_group_contact.group_id = civicrm_subscription_history.group_id WHERE contact_a.id = 9686 AND civicrm_group.is_active = 1 AND civicrm_group_contact.status = 'Added' AND ( ( civicrm_group_contact.group_id IN (Actieve leden, Leden, Perscontacten, PUB - Telenet klanten, PUB nieuwsbrief (Telenet klanten), STUG - Scarlet klanten, STUG nieuwsbrief (Scarlet klanten), Zakelijke gebruikers ) AND civicrm_group_contact.status = 'Added' ) ) ORDER BY civicrm_group.title [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 'leden, Leden, Perscontacten, PUB - Telenet klanten, PUB nieuwsbrief (Telenet kla' at line 10]"]
)