diff --git a/booking.rooms.inc b/booking.rooms.inc index 63788d9..0c2137e 100644 --- a/booking.rooms.inc +++ b/booking.rooms.inc @@ -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();