From cf79ac587351fde6556cc90a1de27c7c842830df Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Wed, 16 Aug 2017 14:28:20 +0100 Subject: [PATCH] Fix crash when event_id is not set --- CRM/Core/DAO.php | 2 +- CRM/Event/Selector/Search.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index 58e556e2a7..7835ae0261 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -1088,7 +1088,7 @@ FROM civicrm_domain empty($searchValue) || trim(strtolower($searchValue)) == 'null' ) { - // adding this year since developers forget to check for an id + // adding this here since developers forget to check for an id // or for the 'null' (which is a bad DAO kludge) // and hence we get the first value in the db CRM_Core_Error::fatal(); diff --git a/CRM/Event/Selector/Search.php b/CRM/Event/Selector/Search.php index bdef479abb..a9432f1f56 100644 --- a/CRM/Event/Selector/Search.php +++ b/CRM/Event/Selector/Search.php @@ -342,6 +342,11 @@ class CRM_Event_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co } } + // Skip registration if event_id is NULL + if (empty($row['event_id'])) { + continue; + } + //carry campaign on selectors. $row['campaign'] = CRM_Utils_Array::value($result->participant_campaign_id, $allCampaigns); $row['campaign_id'] = $result->participant_campaign_id; -- 2.25.1