From: deb.monish Date: Thu, 26 Oct 2017 08:44:07 +0000 (+0530) Subject: additional fix X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f9585de5e5436d3909c1830543a50cf23fcccc79;p=civicrm-core.git additional fix --- diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index a4e328cb4d..6d772bb78c 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -1865,15 +1865,16 @@ class CRM_Core_Form extends HTML_QuickForm_Page { } $props['select'] = CRM_Utils_Array::value('select', $props, array()) + $defaults; - $this->formatReferenceFieldAttributes($props); + $this->formatReferenceFieldAttributes($props, get_class($this)); return $this->add('text', $name, $label, $props, $required); } /** - * @param $props + * @param array $props + * @param string $formName */ - private function formatReferenceFieldAttributes(&$props) { - CRM_Utils_Hook::alterEntityRefParams($props); + private function formatReferenceFieldAttributes(&$props, $formName) { + CRM_Utils_Hook::alterEntityRefParams($props, $formName); $props['data-select-params'] = json_encode($props['select']); $props['data-api-params'] = $props['api'] ? json_encode($props['api']) : NULL; $props['data-api-entity'] = $props['entity']; diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index 78ae0bc6b1..12e595fb5c 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -2389,8 +2389,8 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - public static function alterEntityRefParams(&$params) { - return self::singleton()->invoke(array('params'), $params, self::$_nullObject, + public static function alterEntityRefParams(&$params, $formName) { + return self::singleton()->invoke(array('params', 'formName'), $params, $formName, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_alterEntityRefParams' );