From: Frank J. Gómez Date: Fri, 21 Dec 2018 20:03:48 +0000 (-0500) Subject: Improved support for case variability in UF* API calls. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6d3a1c2b848ead1618212f1577cff5289b70b4d9;p=civicrm-core.git Improved support for case variability in UF* API calls. --- diff --git a/CRM/Utils/String.php b/CRM/Utils/String.php index 2225befa96..b45c228ae7 100644 --- a/CRM/Utils/String.php +++ b/CRM/Utils/String.php @@ -120,8 +120,12 @@ class CRM_Utils_String { $fragments = explode('_', $string); foreach ($fragments as & $fragment) { $fragment = ucfirst($fragment); + // Special case: UFGroup, UFJoin, UFMatch, UFField (if passed in without underscores) + if (strpos($fragment, 'Uf') === 0 && strlen($string) > 2) { + $fragment = 'UF' . ucfirst(substr($fragment, 2)); + } } - // Special case: UFGroup, UFJoin, UFMatch, UFField + // Special case: UFGroup, UFJoin, UFMatch, UFField (if passed in underscore-separated) if ($fragments[0] === 'Uf') { $fragments[0] = 'UF'; }