This commit is contained in:
Nathan Coad
2018-05-02 14:02:40 +10:00
parent ccc5a8d772
commit 44fcfef61f

View File

@@ -131,8 +131,10 @@ function booking_variety_session_callback($form, &$form_state) {
$options = _booking_get_variety_timeslot_options($timeslot->tid);
watchdog('booking_debug', 'Timeslot @tid form state value: <pre>@info</pre>',
array('@tid' => $timeslot->tid, '@info' => print_r($form_state['values'], true)));
watchdog('booking_debug', 'Setting default value to @value', array('@value' =>
isset($form_state['values'][$fieldname]) ? $form_state['values'][$fieldname] : 0));
watchdog('booking_debug', 'Setting timeslot @tid default value to @value', array(
'@tid' => $timeslot->tid,
'@value' => isset($form_state['values'][$fieldname]) ? $form_state['values'][$fieldname] : 0)
);
//re-create the form element for this timeslot
$form['variety-sessions'][$fieldname] = array(
@@ -142,7 +144,7 @@ function booking_variety_session_callback($form, &$form_state) {
'#options' => $options,
'#prefix' => '<div id="booking_variety_session_' . $timeslot->tid . 'wrapper">',
'#suffix' => '</div>',
'#default_value' => isset($form_state['values'][$fieldname]) ? $form_state['values'][$fieldname] : 0,
'#default_value' => 1,
);
// Tell drupal to update the wrapper for this field