CiviCase - Fix crash when fetching status_id pseudoconstant
authorcolemanw <coleman@civicrm.org>
Wed, 10 Jan 2024 18:11:48 +0000 (13:11 -0500)
committercolemanw <coleman@civicrm.org>
Wed, 10 Jan 2024 18:12:32 +0000 (13:12 -0500)
Fixes crash reported in https://civicrm.stackexchange.com/q/46209

CRM/Case/BAO/Case.php

index c0d1a23dbe18abc0dc8daf2985721c797a36a3c8..f58198ba4343853cd6610f9dc9c28e83b0fe22ac 100644 (file)
@@ -2990,7 +2990,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')';
 
       // Filter status id by case type id
       case 'status_id':
-        if (!empty($props['case_type_id'])) {
+        if (!empty($props['case_type_id']) && is_scalar($props['case_type_id'])) {
           $idField = is_numeric($props['case_type_id']) ? 'id' : 'name';
           $caseType = civicrm_api3('CaseType', 'getsingle', [$idField => $props['case_type_id'], 'return' => 'definition']);
           if (!empty($caseType['definition']['statuses'])) {