Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Critical
-
Resolution: Fixed/Completed
-
Affects Version/s: 1.4
-
Fix Version/s: 1.4
-
Component/s: None
-
Labels:None
Description
This appears to be a very similar issue to CRM-1086, where doing advanced search as a user without "View All Contacts" can generate bad SQL while the Advanced Search page is rendering. Reproducing on my laptop has exactly the same procedure, but the actual error is different.
This is occurring on my laptop; I'm not sure if it will occur on the production Bioneer server, although I suspect that with similar settings, it would (permissions are slightly different on the test system).
I don't have a full stack trace, but here is the basic error information:
Sorry. A non-recoverable error has occurred.
Database Error Code: Unknown column 'civicrm_group_contact.group_id' in 'where clause', 1054
Return to CiviCRM menu.
error
Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => handle
)
[code] => -19
[message] => DB Error: no such field
[mode] => 16
[debug_info] => SELECT DISTINCT UPPER(LEFT(civicrm_contact.sort_name, 1)) as sort_name FROM civicrm_contact
LEFT JOIN civicrm_custom_value custom_value_36 ON custom_value_36.custom_field_id = 36 AND custom_value_36.entity_table = 'civicrm_contact' AND custom_value_36.entity_id = civicrm_contact.id WHERE civicrm_contact.domain_id = 1 AND ( ( civicrm_group_contact.group_id IN (12, 16, 8, 18, 24, 15, 1, 19, 38, 4, 20, 36, 35, 11, 23, 26, 3, 7, 33, 39, 30, 10, 32, 31, 2, 21, 41, 17, 13, 14, 6, 22, 29 ) AND civicrm_group_contact.status = 'Added' ) OR civicrm_contact.domain_id = 1 AND civicrm_group_contact.group_id IN (16) AND civicrm_group_contact.status IN ("Added") AND LOWER(civicrm_state_province.name) = "california" AND LOWER(custom_value_11.char_data) LIKE '%s_s_li%' AND LOWER(custom_value_8.char_data) LIKE '%current%' AND custom_value_10.date_data >= 20060301 OR civicrm_contact.domain_id = 1 AND custom_value_36.int_data = 1 ) ORDER BY LEFT(civicrm_contact.sort_name, 1) [nativecode=1054 ** Unknown column 'civicrm_group_contact.group_id' in 'where clause']
[type] => DB_Error
[user_info] => SELECT DISTINCT UPPER(LEFT(civicrm_contact.sort_name, 1)) as sort_name FROM civicrm_contact
LEFT JOIN civicrm_custom_value custom_value_36 ON custom_value_36.custom_field_id = 36 AND custom_value_36.entity_table = 'civicrm_contact' AND custom_value_36.entity_id = civicrm_contact.id WHERE civicrm_contact.domain_id = 1 AND ( ( civicrm_group_contact.group_id IN (12, 16, 8, 18, 24, 15, 1, 19, 38, 4, 20, 36, 35, 11, 23, 26, 3, 7, 33, 39, 30, 10, 32, 31, 2, 21, 41, 17, 13, 14, 6, 22, 29 ) AND civicrm_group_contact.status = 'Added' ) OR civicrm_contact.domain_id = 1 AND civicrm_group_contact.group_id IN (16) AND civicrm_group_contact.status IN ("Added") AND LOWER(civicrm_state_province.name) = "california" AND LOWER(custom_value_11.char_data) LIKE '%s_s_li%' AND LOWER(custom_value_8.char_data) LIKE '%current%' AND custom_value_10.date_data >= 20060301 OR civicrm_contact.domain_id = 1 AND custom_value_36.int_data = 1 ) ORDER BY LEFT(civicrm_contact.sort_name, 1) [nativecode=1054 ** Unknown column 'civicrm_group_contact.group_id' in 'where clause']
[to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT DISTINCT UPPER(LEFT(civicrm_contact.sort_name, 1)) as sort_name FROM civicrm_contact
LEFT JOIN civicrm_custom_value custom_value_36 ON custom_value_36.custom_field_id = 36 AND custom_value_36.entity_table = 'civicrm_contact' AND custom_value_36.entity_id = civicrm_contact.id WHERE civicrm_contact.domain_id = 1 AND ( ( civicrm_group_contact.group_id IN (12, 16, 8, 18, 24, 15, 1, 19, 38, 4, 20, 36, 35, 11, 23, 26, 3, 7, 33, 39, 30, 10, 32, 31, 2, 21, 41, 17, 13, 14, 6, 22, 29 ) AND civicrm_group_contact.status = 'Added' ) OR civicrm_contact.domain_id = 1 AND civicrm_group_contact.group_id IN (16) AND civicrm_group_contact.status IN ("Added") AND LOWER(civicrm_state_province.name) = "california" AND LOWER(custom_value_11.char_data) LIKE '%s_s_li%' AND LOWER(custom_value_8.char_data) LIKE '%current%' AND custom_value_10.date_data >= 20060301 OR civicrm_contact.domain_id = 1 AND custom_value_36.int_data = 1 ) ORDER BY LEFT(civicrm_contact.sort_name, 1) [nativecode=1054 ** Unknown column 'civicrm_group_contact.group_id' in 'where clause']"]