Jump to content

Recommended Posts

Posted

Hi

I have installed Classroom bookings and it is working well, however when I have started to input timetabled lessons, I occasionally get "There is already a booking for that date, period and room.". I get this message even if I am setting up a new room.

 

Is this a known thing? If so does anyone know a workaround?

 

Thanks!

 

Capture.PNG

Posted

Hi executiverocker, author of classroombookings here! Sorry to hear you've had this problem.

 

This isn't something I've had reported to me before or that I've noticed myself, so it's a new one to me. That message is in response to the system making sure there isn't a booking already scheduled for the same time as the one you're making. But if there definitely isn't one, this isn't ideal!

 

I haven't managed to reproduce the issue and get that error to come up when it shouldn't do. Could you give me some more detail about it please? Things like...

  • What are the steps you take immediately before seeing the message?
  • What method are you taking to get it? E.g. Ticking the boxes on the bookings page and clicking Make Recurring button, or clicking a single "Book" link and filling in the form?
  • What values are involved - e.g. date, week, day etc.

 

If you could include screenshots that would be really useful as well.

 

Finally, if you are desparate to get some bookings in and want to temporarily disable this check - it's not a feature that is simply enabled or disabled, but it's possible to edit the code to bypass it.

 

File: application/controllers/Bookings.php @ Line 472

 

private function _check_unique_booking($data)
{
return true;    // <-- add this line here
$bookings = $this->bookings_model->GetUnique(array(
	'date' => $data['date'],
	'period_id' => $data['period_id'],
	'room_id' => $data['room_id'],
	'booking_id' => $data['booking_id'],
));
return count($bookings) == 0;
}

 

 

 

Thanks,

Craig.

  • Thanks 1
Posted
Hi executiverocker, author of classroombookings here! Sorry to hear you've had this problem.

 

This isn't something I've had reported to me before or that I've noticed myself, so it's a new one to me. That message is in response to the system making sure there isn't a booking already scheduled for the same time as the one you're making. But if there definitely isn't one, this isn't ideal!

 

I haven't managed to reproduce the issue and get that error to come up when it shouldn't do. Could you give me some more detail about it please? Things like...

  • What are the steps you take immediately before seeing the message?
  • What method are you taking to get it? E.g. Ticking the boxes on the bookings page and clicking Make Recurring button, or clicking a single "Book" link and filling in the form?
  • What values are involved - e.g. date, week, day etc.

 

If you could include screenshots that would be really useful as well.

 

Finally, if you are desparate to get some bookings in and want to temporarily disable this check - it's not a feature that is simply enabled or disabled, but it's possible to edit the code to bypass it.

 

File: application/controllers/Bookings.php @ Line 472

 

private function _check_unique_booking($data)
{
   return true;    // <-- add this line here
   $bookings = $this->bookings_model->GetUnique(array(
       'date' => $data['date'],
       'period_id' => $data['period_id'],
       'room_id' => $data['room_id'],
       'booking_id' => $data['booking_id'],
   ));
   return count($bookings) == 0;
}

 

 

 

Thanks,

Craig.

 

1. I can create a room and after (usually) creating a weeks worth of recurring lessons, once I get onto week 2 and start creating recurring lessons I start getting the error about there is already a booking etc.

2. I'm clicking into a single booking and using the recurring options at the bottom.

3. Date is in form of 14/03/2019 , Period using 24h clock and we have week 1 and week 2 schedules.

 

I have sent you a message with a screen recording.

Posted

Thanks for the message, that video was very helpful!

 

In response to the second message, making recurring bookings in bulk - from the bookings page - doesn't go through the same checking process at the moment - so that is one way to do it for bookings that have the same details :)

 

I will look into why that's happening and hopefully get a fix out for that very soon :)

Posted

Hi again!

 

I think I've managed to track it down and fix it... it seems the chosen week wasn't being passed into the checking function, so it was falling back on the week assigned to the date - or today's date if that wasn't present either. Sorry about that!

 

Can you try replacing the two files at the locations below in your installation, with new ones to see if that has resolved it?

 

application/controllers/Bookings.php

application/models/Bookings_model.php

 

If you're comfortable with code you can view only the changed lines here: changes.

 

 

Let me know how that goes please!

 

Craig.

  • 5 months later...
Posted
I stumbled across this post as I was running into the same trouble. I replaced the files as suggested, the error persisted. In the end we've used the "Return true" workaround to get the timetable populated.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...