From b093546a0fa567ecaf33ab8af54791c59978f05a Mon Sep 17 00:00:00 2001 From: Brian Shaughnessy Date: Fri, 27 Sep 2013 12:53:10 -0400 Subject: [PATCH] CRM-13455 improve getEvents query to account for empty end_date --- CRM/Event/BAO/Event.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index 90c85c8382..8520ec5453 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -279,7 +279,12 @@ WHERE ( civicrm_event.is_template IS NULL OR civicrm_event.is_template = 0 )"; elseif ($all == 0) { // find only events ending in the future $endDate = date('YmdHis'); - $query .= " AND ( `end_date` >= {$endDate} OR end_date IS NULL )"; + $query .= " + AND ( `end_date` >= {$endDate} OR + ( + ( end_date IS NULL OR end_date = '' ) AND start_date >= {$endDate} + ) + )"; } elseif ($all == 2) { // find only events starting in the last 3 months -- 2.25.1