Added call to hook_civicrm_fieldOptions() from within CRM_Core_PseudoConstant::get...
authorTobias Lounsbury <tobiaslounsbury@gmail.com>
Thu, 17 Mar 2016 20:01:41 +0000 (13:01 -0700)
committerTobias Lounsbury <tobiaslounsbury@gmail.com>
Thu, 17 Mar 2016 20:01:41 +0000 (13:01 -0700)
CRM/Core/PseudoConstant.php

index 509a3ea29d55f8308f8ac27dc3cd64c3eb0781d4..4c90b16946cd831e8ab26cc4434112020486eb55 100644 (file)
@@ -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