From bdfc89f9040fa721bde3b47b5b956c0deb11d07f Mon Sep 17 00:00:00 2001 From: Civiware Solutions Date: Thu, 27 Dec 2018 00:37:39 +0000 Subject: [PATCH] Show custom fields only on search pages --- softcreditcustomfields.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/softcreditcustomfields.php b/softcreditcustomfields.php index 485cc13..3e6465f 100644 --- a/softcreditcustomfields.php +++ b/softcreditcustomfields.php @@ -167,7 +167,7 @@ function softcreditcustomfields_civicrm_preProcess($formName, &$form) { * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_buildForm */ function softcreditcustomfields_civicrm_buildForm($formName, &$form) { - if ('CRM_Contribute_Form_Search' == $formName + if (('CRM_Contribute_Form_Search' == $formName && $form->getVar('_context') == 'search') || ('CRM_Contact_Form_Search_Advanced' == $formName && ('CiviContribute' == $form->_searchPane || $form->_flagSubmitted)) ) { CRM_Contribute_BAO_Query::addCustomFormFields($form, ['ContributionSoft']);