Browse Source

addressing off by one issue when testing for max bookings

master
ppound 4 years ago
parent
commit
9f90f95f39
  1. 2
      roblib_bee_limits.module

2
roblib_bee_limits.module

@ -146,7 +146,7 @@ function roblib_bee_limits_check_reservations($user, $form, &$form_state) {
$event = NULL; $event = NULL;
} }
$max_bookings_allowed = roblib_bee_limits_get_max_bookings_allowed($user); $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 $form_state->setError($form, t('Reservation exceeded your maximum number
of active bookings allowed. You currently have @active_bookings active reservations, of active bookings allowed. You currently have @active_bookings active reservations,
You are allowed @max_bookings .', array('@active_bookings' => $active_bookings, You are allowed @max_bookings .', array('@active_bookings' => $active_bookings,

Loading…
Cancel
Save