From 6d3a1c2b848ead1618212f1577cff5289b70b4d9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Frank=20J=2E=20G=C3=B3mez?= Date: Fri, 21 Dec 2018 15:03:48 -0500 Subject: [PATCH] Improved support for case variability in UF* API calls. --- CRM/Utils/String.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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'; } -- 2.25.1