diff --git a/softcreditcustomfields.php b/softcreditcustomfields.php index 8cebf3d..485cc13 100644 --- a/softcreditcustomfields.php +++ b/softcreditcustomfields.php @@ -167,8 +167,13 @@ 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 + || ('CRM_Contact_Form_Search_Advanced' == $formName && ('CiviContribute' == $form->_searchPane || $form->_flagSubmitted)) + ) { CRM_Contribute_BAO_Query::addCustomFormFields($form, ['ContributionSoft']); + if ('CRM_Contact_Form_Search_Advanced' == $formName && 'CiviContribute' != $form->_searchPane) { + return; + } CRM_Core_Region::instance('page-footer')->add(array( 'template' => "CRM/Contribute/Form/Search/SoftCredit-Search.tpl", ));