Skip to content

Commit

Permalink
Issue #2731317 by cimo75, acrollet: Respect mandatory options
Browse files Browse the repository at this point in the history
  • Loading branch information
acrollet committed Apr 11, 2018
1 parent 4973742 commit 64fc439
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rooms_views.module
Original file line number Diff line number Diff line change
Expand Up @@ -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]) &&
Expand Down

0 comments on commit 64fc439

Please sign in to comment.