From 8065136a6f1c960bb46b2640a0c0aa6062a52f0b Mon Sep 17 00:00:00 2001 From: yashodha Date: Tue, 21 Jul 2015 16:20:04 +0530 Subject: [PATCH] CRM-15564: Event info page shows past event Closed with Active Registration Windows ---------------------------------------- * CRM-15564: Event info page shows past event Closed with Active Registration Windows https://issues.civicrm.org/jira/browse/CRM-15564 --- CRM/Event/BAO/Event.php | 5 +---- CRM/Event/Form/Registration.php | 8 +------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index 9a4f3d2aaf..998e1e8392 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -1923,10 +1923,7 @@ WHERE ce.loc_block_id = $locBlockId"; if ($startDate && $startDate >= $now) { $validDate = FALSE; } - if ($endDate && $endDate < $now) { - $validDate = FALSE; - } - if ($eventEnd && $eventEnd < $now) { + if ($endDate && $endDate < $now && $eventEnd && $eventEnd < $now) { $validDate = FALSE; } diff --git a/CRM/Event/Form/Registration.php b/CRM/Event/Form/Registration.php index 8538460866..ff49b532fe 100644 --- a/CRM/Event/Form/Registration.php +++ b/CRM/Event/Form/Registration.php @@ -1515,15 +1515,9 @@ WHERE v.option_group_id = g.id $this->_values['event'] )); $eventEndDate = CRM_Utils_Date::processDate(CRM_Utils_Array::value('event_end_date', $this->_values['event'])); - if ( - $endDate && - $endDate < $now - ) { + if ($endDate && ($endDate < $now) && !empty($eventEndDate) && ($eventEndDate < $now)) { CRM_Core_Error::statusBounce(ts('Registration for this event ended on %1', array(1 => CRM_Utils_Date::customFormat(CRM_Utils_Array::value('registration_end_date', $this->_values['event'])))), $redirect); } - if (!empty($eventEndDate) && $eventEndDate < $now) { - CRM_Core_Error::statusBounce(ts('Event ended on %1', array(1 => CRM_Utils_Date::customFormat(CRM_Utils_Array::value('event_end_date', $this->_values['event'])))), $redirect); - } } } -- 2.25.1