From fce45661bc83a68a01e3582b4a0f632053130bbe Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Tue, 16 Aug 2016 15:25:19 +1200 Subject: [PATCH] CRM-19081 fix mapping load function for legacy smart groups --- CRM/Core/BAO/Mapping.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CRM/Core/BAO/Mapping.php b/CRM/Core/BAO/Mapping.php index dac37cd33e..5914b1c2e7 100644 --- a/CRM/Core/BAO/Mapping.php +++ b/CRM/Core/BAO/Mapping.php @@ -1004,6 +1004,12 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { $value = explode(',', $value); $value = array($params['operator'][$key][$k] => $value); } + // CRM-19081 Fix legacy StateProvince Field Values. + // These derive from smart groups created using search builder under older + // CiviCRM versions. + if (!is_numeric($value) && $fldName == 'state_province') { + $value = CRM_Core_PseudoConstant::getKey('CRM_Core_BAO_Address', 'state_province_id', $value); + } if ($row) { $fields[] = array( -- 2.25.1