From ca0f1c4b5969344181feb71df9a625c30dc9c2e8 Mon Sep 17 00:00:00 2001 From: Tobias Lounsbury Date: Thu, 17 Mar 2016 13:01:41 -0700 Subject: [PATCH] Added call to hook_civicrm_fieldOptions() from within CRM_Core_PseudoConstant::get() for fields that validate against a callback. --- CRM/Core/PseudoConstant.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CRM/Core/PseudoConstant.php b/CRM/Core/PseudoConstant.php index 509a3ea29d..4c90b16946 100644 --- a/CRM/Core/PseudoConstant.php +++ b/CRM/Core/PseudoConstant.php @@ -252,7 +252,10 @@ class CRM_Core_PseudoConstant { // if callback is specified.. if (!empty($pseudoconstant['callback'])) { - return call_user_func(Civi\Core\Resolver::singleton()->get($pseudoconstant['callback'])); + $fieldOptions = call_user_func(Civi\Core\Resolver::singleton()->get($pseudoconstant['callback'])); + //CRM-18223: Allow additions to field options via hook. + CRM_Utils_Hook::fieldOptions($entity, $fieldName, $fieldOptions, $params); + return $fieldOptions; } // Merge params with schema defaults -- 2.25.1