Commit 8245e51b authored by droces's avatar droces

Fixed validation for bookable unit id in BookingSettingsForm

parent b2b42c8e
......@@ -118,10 +118,12 @@ class BookingSettingsForm extends ConfigFormBase {
// Validate site bookable unit
$bookable_nid = $form_state->getValue('bookable');
$bookable = node_load($bookable_nid);
if (! $bookable) {
$form_state->setErrorByName('bookable',
$this->t("No bookable unit was found with that ID.", array('%address' => $address)));
if ($bookable_nid) {
$bookable = node_load($bookable_nid);
if (! $bookable) {
$form_state->setErrorByName('bookable',
$this->t("No bookable unit was found with that ID."));
}
}
// Validate notification email addresses
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment