Show custom fields only on search pages

This commit is contained in:
CiviWare Solutions 2018-12-27 00:37:39 +00:00
parent 20c8985954
commit bdfc89f904

View File

@ -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']);