additional fix
authordeb.monish <monish.deb@jmaconsulting.biz>
Thu, 26 Oct 2017 08:44:07 +0000 (14:14 +0530)
committerdeb.monish <monish.deb@jmaconsulting.biz>
Thu, 26 Oct 2017 08:44:07 +0000 (14:14 +0530)
CRM/Core/Form.php
CRM/Utils/Hook.php

index a4e328cb4da1b17a7438c742cb1720dc08104b40..6d772bb78cd31ed1c471df9c400dc4b5865fdb58 100644 (file)
@@ -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'];
index 78ae0bc6b1a9bab9bf6320993d3b07850a044742..12e595fb5cce795ecf5424be3cb4fcc565685269 100644 (file)
@@ -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'
     );