Upgraded from Civi 5.52 to Civi 5.68.1 on Drupal 7, PHP 7.3.13, Mysql 5.74. The errors are all revolving around activities. Anywhere in the UI that involves showing activities is returning a DB error in the UI and failing entirely. So, for example,
- Viewing a contact fails
- Viewing any report that involves activities fails
The error I see in ConfigAndLog is always the same:
Unexpected result from getcountArray ( [error_code] => -2 [sql] => [debug_info] => SELECT count(*) as c FROM civicrm_activity a LEFT JOIN civicrm_case_activity actjoin_case_id ON (actjoin_case_id.activity_id = a.id) WHERE (((`a`.`activity_type_id` Array))) AND (a.id IN (SELECT activity_id FROM civicrm_activity_contact WHERE contact_id = "412")) AND (actjoin_case_id.case_id IS NULL) AND (a.is_current_revision = "1") AND (a.activity_type_id IN ("1", "2", "3", "61", "49", "66", "50", "56", "51", "58", "59", "9", "5", "6", "7", "8", "4", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "44", "45", "46", "47", "48", "52", "53", "54", "55", "57", "60", "62", "63", "64", "65", "67", "68", "69", "70", "71", "72", "74", "76", "78", "80", "82")) AND (a.is_test = "0") AND (a.is_deleted = "0") [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 'Array))) AND (a.id IN (SELECT activity_id FROM civicrm_activity_contact WHERE ' at line 4] [entity] => Activity [action] => get [is_error] => 1 [error_message] => DB Error: syntax error [debug_information] => )
So it's the long list of activity types that seems to be throwing a SQL error.
Looking through ConfigAndLog, I don't see any errors showing throughout the upgrade process itself. And the rest of the site functions fine.
I have tried:
- Looking at the list of activities. There are none that are disabled or anything like that.
- Recreating reports that throw the error. That doesn't do anything. And anyway the error occurs even when viewing a contact.
- Searching here for any instances of the error
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 'Array
but I don't see anything. - Tried searching through the CiviCRM issues log for anything related to activities. Anything that is listed there looks like it got rolled into 5.68.1 though.
- Disabling CiviCase, because I saw a note in the issues log about CiviCase and activities for administrators. That did not do anything.
I'm stumped and not sure where to go from here.
Any suggestions welcome.