From 9f90f95f396d5ae23dcebeba66bc49c71c5ac15c Mon Sep 17 00:00:00 2001 From: ppound Date: Fri, 23 Oct 2020 09:27:36 -0300 Subject: [PATCH] addressing off by one issue when testing for max bookings --- roblib_bee_limits.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roblib_bee_limits.module b/roblib_bee_limits.module index ddbb76f..a003a30 100644 --- a/roblib_bee_limits.module +++ b/roblib_bee_limits.module @@ -146,7 +146,7 @@ function roblib_bee_limits_check_reservations($user, $form, &$form_state) { $event = NULL; } $max_bookings_allowed = roblib_bee_limits_get_max_bookings_allowed($user); - if($max_bookings_allowed != -1 && $active_bookings > $max_bookings_allowed){ + if($max_bookings_allowed != -1 && $active_bookings >= $max_bookings_allowed){ $form_state->setError($form, t('Reservation exceeded your maximum number of active bookings allowed. You currently have @active_bookings active reservations, You are allowed @max_bookings .', array('@active_bookings' => $active_bookings,