Merge pull request #22805 from braders/permission_denied_wordpress_improvement-altern...
[civicrm-core.git] / CRM / Contribute / Form / Search.php
index 8b2594e073531837b6da60e2f143accbeee8dfad..eac81521722bfbfe897c3c45aa8976b6d28e6d32 100644 (file)
@@ -258,6 +258,11 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search {
       // @todo - stop changing formValues - respect submitted form values, change a working array.
       $this->_formValues['contribution_test'] = 0;
     }
+    // We don't show template records in summaries or dashboards
+    if (empty($this->_formValues['is_template']) && $this->_force && !empty($this->_context) && ($this->_context === 'dashboard' || $this->_context === 'contribution')) {
+      // @todo - stop changing formValues - respect submitted form values, change a working array.
+      $this->_formValues['is_template'] = 0;
+    }
 
     foreach ([
       'contribution_amount_low',