From 726eddad62db490cab46d483885ae74795a6e636 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Wed, 8 Jun 2022 10:02:25 +0100 Subject: [PATCH] Towards consistency for displaying test entities. Stop hiding test entities on some dashboards --- CRM/Activity/Form/Search.php | 5 ----- CRM/Contribute/Form/Search.php | 5 ----- CRM/Event/Form/Search.php | 5 ----- CRM/Member/Form/Search.php | 5 ----- CRM/Pledge/Form/Search.php | 5 ----- CRM/Pledge/Selector/Search.php | 6 ++++++ 6 files changed, 6 insertions(+), 25 deletions(-) diff --git a/CRM/Activity/Form/Search.php b/CRM/Activity/Form/Search.php index 6b3e467266..4ea78a5af0 100644 --- a/CRM/Activity/Form/Search.php +++ b/CRM/Activity/Form/Search.php @@ -180,11 +180,6 @@ class CRM_Activity_Form_Search extends CRM_Core_Form_Search { $this->_formValues = CRM_Contact_BAO_SavedSearch::getFormValues($this->_ssID); } - // We don't show test records in summaries or dashboards - if (empty($this->_formValues['activity_test']) && $this->_force) { - $this->_formValues['activity_test'] = 0; - } - $this->_queryParams = CRM_Contact_BAO_Query::convertFormValues($this->_formValues); $this->set('queryParams', $this->_queryParams); diff --git a/CRM/Contribute/Form/Search.php b/CRM/Contribute/Form/Search.php index eac8152172..a25c1bad97 100644 --- a/CRM/Contribute/Form/Search.php +++ b/CRM/Contribute/Form/Search.php @@ -253,11 +253,6 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search { // @todo - stop changing formValues - respect submitted form values, change a working array. $this->fixFormValues(); - // We don't show test records in summaries or dashboards - if (empty($this->_formValues['contribution_test']) && $this->_force && !empty($this->_context) && $this->_context === 'dashboard') { - // @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. diff --git a/CRM/Event/Form/Search.php b/CRM/Event/Form/Search.php index 0c2ce4dbf5..a158e43862 100644 --- a/CRM/Event/Form/Search.php +++ b/CRM/Event/Form/Search.php @@ -283,11 +283,6 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { $this->_formValues = CRM_Contact_BAO_SavedSearch::getFormValues($this->_ssID); } - // We don't show test records in summaries or dashboards - if (empty($this->_formValues['participant_test']) && $this->_force) { - $this->_formValues["participant_test"] = 0; - } - $this->_queryParams = CRM_Contact_BAO_Query::convertFormValues($this->_formValues, 0, FALSE, NULL, ['event_id']); $this->set('queryParams', $this->_queryParams); diff --git a/CRM/Member/Form/Search.php b/CRM/Member/Form/Search.php index dd937142ff..c976c64653 100644 --- a/CRM/Member/Form/Search.php +++ b/CRM/Member/Form/Search.php @@ -220,11 +220,6 @@ class CRM_Member_Form_Search extends CRM_Core_Form_Search { $this->fixFormValues(); - // We don't show test records in summaries or dashboards - if (empty($this->_formValues['member_test']) && $this->_force) { - $this->_formValues["member_test"] = 0; - } - $this->_queryParams = CRM_Contact_BAO_Query::convertFormValues($this->_formValues, 0, FALSE, NULL, $this->entityReferenceFields); $this->set('queryParams', $this->_queryParams); diff --git a/CRM/Pledge/Form/Search.php b/CRM/Pledge/Form/Search.php index 7f7e75c529..2a09f8295c 100644 --- a/CRM/Pledge/Form/Search.php +++ b/CRM/Pledge/Form/Search.php @@ -190,11 +190,6 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form_Search { $this->fixFormValues(); - // We don't show test records in summaries or dashboards - if (empty($this->_formValues['pledge_test']) && $this->_force) { - $this->_formValues["pledge_test"] = 0; - } - foreach (['pledge_amount_low', 'pledge_amount_high'] as $f) { if (isset($this->_formValues[$f])) { $this->_formValues[$f] = CRM_Utils_Rule::cleanMoney($this->_formValues[$f]); diff --git a/CRM/Pledge/Selector/Search.php b/CRM/Pledge/Selector/Search.php index e803a9be09..01c4fae1ec 100644 --- a/CRM/Pledge/Selector/Search.php +++ b/CRM/Pledge/Selector/Search.php @@ -291,6 +291,12 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base { while ($result->fetch()) { $row = []; + + // Ignore rows where we dont have an id. + if (empty($result->pledge_id)) { + continue; + } + // the columns we are interested in foreach (self::$_properties as $property) { if (isset($result->$property)) { -- 2.25.1