bugfix in booking_room_edit_form_validate

This commit is contained in:
2016-05-19 08:20:47 +10:00
parent 1393cf3387
commit ea0a6bb8fc

View File

@@ -294,7 +294,13 @@ function booking_room_edit_form_validate($form, &$form_state) {
return;
}
//get the specific room definition from the database
//check if the location but not room number has been set
if ($values['booking_room_location_id'] > 0 && $values['booking_room_number'] == 0) {
//return here, since there is nothing we need to validate yet
return;
}
//get the room definition from the database so we can verify there is capacity
$details = db_query("SELECT * FROM {booking_room_definition} WHERE booking_room_location_id = :lid AND booking_room_number = :num",
array(':lid' => $values['booking_room_location_id'], ':num' => $values['booking_room_number']))->fetchObject();