Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.6.25
-
Fix Version/s: 5.0.0
-
Component/s: CiviReport
-
Labels:
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Funding Source:Needs Funding
-
Verified?:No
Description
Warning: Missing argument 1 for CRM_Report_Form_Activity::from(), called in /var/www/html/test/mirth/wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php on line 2651 and defined in /var/www/html/test/mirth/wp-content/plugins/civicrm/civicrm/CRM/Report/Form/Activity.php on line 428
Notice: Undefined variable: recordType in /var/www/html/test/mirth/wp-content/plugins/civicrm/civicrm/CRM/Report/Form/Activity.php on line 435
Notice: Undefined variable: recordType in /var/www/html/test/mirth/wp-content/plugins/civicrm/civicrm/CRM/Report/Form/Activity.php on line 454
Notice: Undefined variable: recordType in /var/www/html/test/mirth/wp-content/plugins/civicrm/civicrm/CRM/Report/Form/Activity.php on line 473
{"error_code":"syntax error","sql":"SELECT civicrm_contact_source.id as civicrm_contact_contact_source_id, civicrm_contact_assignee.id as civicrm_contact_contact_assignee_id, civicrm_contact_target.id as civicrm_contact_contact_target_id, activity_civireport.id as civicrm_activity_id, activity_civireport.source_record_id as civicrm_activity_source_record_id, activity_civireport.activity_type_id as civicrm_activity_activity_type_id, activity_civireport.subject as civicrm_activity_activity_subject, activity_civireport.activity_date_time as civicrm_activity_activity_date_time, activity_civireport.status_id as civicrm_activity_status_id, activity_civireport.duration as civicrm_activity_duration, activity_civireport.details as civicrm_activity_details \n LEFT JOIN civicrm_address address_civireport\n ON (contact_civireport.id =\n address_civireport.contact_id) AND\n address_civireport.is_primary = 1\n WHERE activity_civireport.is_test = 0 AND\n activity_civireport.is_deleted = 0 AND\n activity_civireport.is_current_revision = 1 AND ( activity_civireport.activity_type_id IN (72) ) AND contact_civireport.id IN (\n SELECT DISTINCT cgroup_civireport.contact_id\n FROM civicrm_group_contact cgroup_civireport\n WHERE cgroup_civireport.group_id IN (82, 76, 84) AND cgroup_civireport.status = 'Added'\n ) GROUP BY activity_civireport.id ORDER BY civicrm_activity_activity_date_time ASC, field(civicrm_activity_activity_type_id, 37, 38, 39, 40, 19, 35, 68, 36, 8, 17, 7, 71, 69, 3, 70, 12, 45, 1, 34, 4, 2, 22, 44, 9, 72) ASC LIMIT 500 [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LEFT JOIN civicrm_address address_civireport\n ON (cont' at line 2]","tip":"add debug=1 to your API call to have more info about the error","is_error":1,"error_message":"DB Error: syntax error","debug_information":"SELECT civicrm_contact_source.id as civicrm_contact_contact_source_id, civicrm_contact_assignee.id as civicrm_contact_contact_assignee_id, civicrm_contact_target.id as civicrm_contact_contact_target_id, activity_civireport.id as civicrm_activity_id, activity_civireport.source_record_id as civicrm_activity_source_record_id, activity_civireport.activity_type_id as civicrm_activity_activity_type_id, activity_civireport.subject as civicrm_activity_activity_subject, activity_civireport.activity_date_time as civicrm_activity_activity_date_time, activity_civireport.status_id as civicrm_activity_status_id, activity_civireport.duration as civicrm_activity_duration, activity_civireport.details as civicrm_activity_details \n LEFT JOIN civicrm_address address_civireport\n ON (contact_civireport.id =\n address_civireport.contact_id) AND\n address_civireport.is_primary = 1\n WHERE activity_civireport.is_test = 0 AND\n activity_civireport.is_deleted = 0 AND\n activity_civireport.is_current_revision = 1 AND ( activity_civireport.activity_type_id IN (72) ) AND contact_civireport.id IN (\n SELECT DISTINCT cgroup_civireport.contact_id\n FROM civicrm_group_contact cgroup_civireport\n WHERE cgroup_civireport.group_id IN (82, 76, 84) AND cgroup_civireport.status = 'Added'\n ) GROUP BY activity_civireport.id ORDER BY civicrm_activity_activity_date_time ASC, field(civicrm_activity_activity_type_id, 37, 38, 39, 40, 19, 35, 68, 36, 8, 17, 7, 71, 69, 3, 70, 12, 45, 1, 34, 4, 2, 22, 44, 9, 72) ASC LIMIT 500 [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LEFT JOIN civicrm_address address_civireport\n ON (cont' at line 2]"}
Workaround is to alter wp-content/plugins/civicrm/civicrm/CRM/Report/Form/Activity.php to set a default as follows:
diff Activity.php Activity.php.orig
337c337
< public function select($recordType = 'target') {
—
> public function select($recordType = NULL) {
428c428
< public function from($recordType = 'target') {
—
> public function from($recordType) {
... if you are only interested in one type (target in this case).