Browse Source

fixed bug when deleting an entity that has associated reservations

d9
ppound 3 years ago
parent
commit
c0391680c4
  1. 4
      src/Controller/CalendarController.php

4
src/Controller/CalendarController.php

@ -234,9 +234,13 @@ class CalendarController extends ControllerBase {
// add in pre/post buffer for setup/takedown (rev 7.x-1.3+) // add in pre/post buffer for setup/takedown (rev 7.x-1.3+)
// - if the slot is part of buffer we add "setup" to class // - if the slot is part of buffer we add "setup" to class
// - if we don't have admin rights; we also mark it as booked so no one can book in these slots // - if we don't have admin rights; we also mark it as booked so no one can book in these slots
$preslots = 0;
$postslots = 0;
if(isset($entities[$rid])) {
$category = $categories[$entities[$rid]->$category_field->getString()]; $category = $categories[$entities[$rid]->$category_field->getString()];
$preslots = $category['prebuffer'] / 30; $preslots = $category['prebuffer'] / 30;
$postslots = $category['postbuffer'] / 30; $postslots = $category['postbuffer'] / 30;
}
$startkey = array_search($reservations[$rid][$time]['time'], $times); $startkey = array_search($reservations[$rid][$time]['time'], $times);
$endkey = $startkey + $time_slots; $endkey = $startkey + $time_slots;
$k = $startkey - $preslots; $k = $startkey - $preslots;

Loading…
Cancel
Save