From: Tim Otten Date: Mon, 14 Jul 2014 03:28:20 +0000 (-0700) Subject: api/v3/Case - Continue accepting case-type by title X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3f25e694060f2f000f1c3b5d1b73e3423345082d;p=civicrm-core.git api/v3/Case - Continue accepting case-type by title --- 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']];