From 3f25e694060f2f000f1c3b5d1b73e3423345082d Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Sun, 13 Jul 2014 20:28:20 -0700 Subject: [PATCH] api/v3/Case - Continue accepting case-type by title --- api/v3/Case.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/v3/Case.php b/api/v3/Case.php index ccbe0370cc..6cde101596 100644 --- a/api/v3/Case.php +++ b/api/v3/Case.php @@ -420,6 +420,13 @@ function _civicrm_api3_case_format_params(&$params) { $caseTypes = CRM_Case_PseudoConstant::caseType('name', FALSE); if (empty($params['case_type_id'])) { $params['case_type_id'] = array_search($params['case_type'], $caseTypes); + + // DEPRECATED: lookup by label for backward compatibility + if (!$params['case_type_id']) { + $caseTypeLabels = CRM_Case_PseudoConstant::caseType('title', FALSE); + $params['case_type_id'] = array_search($params['case_type'], $caseTypeLabels); + $params['case_type'] = $caseTypes[$params['case_type_id']]; // label => name + } } elseif (empty($params['case_type'])) { $params['case_type'] = $caseTypes[$params['case_type_id']]; -- 2.25.1