From b44d18ffb966739902f4fb1eed34454ff2d944b5 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Sat, 12 Sep 2009 12:20:54 -0400 Subject: [PATCH] Need to move this comparison after the loop. If we are editing an event that was already accepted, we might hit max_reservations before we get to the event we are editing. --- kronolith/lib/Resource/Single.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/kronolith/lib/Resource/Single.php b/kronolith/lib/Resource/Single.php index f686b4ad6..55f230403 100644 --- a/kronolith/lib/Resource/Single.php +++ b/kronolith/lib/Resource/Single.php @@ -46,17 +46,13 @@ class Kronolith_Resource_Single extends Kronolith_Resource_Base if (!($e->start->compareDateTime($event->end) >= 1 || $e->end->compareDateTime($event->start) <= -1)) { - /* Conflict, but check to see if we are allowed mulitiple */ - if (++$conflicts >= $this->get('max_reservations')) { - return false; - } - + $conflicts++; } } } } - return true; + return ($conflicts < $this->get('max_reservations')); } /** -- 2.11.0