From 64fc439ba1db703d56f0a9ddfe4180b8e01a8bf4 Mon Sep 17 00:00:00 2001 From: Adrian Rollett Date: Wed, 11 Apr 2018 08:00:14 +0200 Subject: [PATCH] Issue #2731317 by cimo75, acrollet: Respect mandatory options --- rooms_views.module | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rooms_views.module b/rooms_views.module index 5342703..60f5566 100644 --- a/rooms_views.module +++ b/rooms_views.module @@ -83,6 +83,12 @@ function rooms_views_booking_button_form($form, &$form_state, $start_date, $end_ ), ); + if ($option['type'] == ROOMS_OPTION_MANDATORY) { + $form['options'][$option_name]['#default_value'] = '1'; + $form['options'][$option_name]['#disabled'] = TRUE; + } + + // Show quantity field selector if in option quantity is set. if (is_numeric($option['quantity'])) { if (isset($form_state['values']['options'][$option_name]) &&