try unsetting input data

This commit is contained in:
Nathan Coad
2018-05-02 14:50:33 +10:00
parent c4cd0e63cb
commit 187f056197

View File

@@ -53,6 +53,14 @@ function booking_variety_regn_form($node, &$form_state)
//for each entry in the variety timeslot table, create a new form select item //for each entry in the variety timeslot table, create a new form select item
foreach($result as $timeslot) { foreach($result as $timeslot) {
$fieldname = 'select-variety-' . $timeslot->tid; $fieldname = 'select-variety-' . $timeslot->tid;
// Make sure we get rid of any stale data
if (isset($form_state['input']['variety-sessions'][$fieldname])) {
watchdog('booking_debug', 'Unsetting stale @name data, was: <pre>@info</pre>',
array('@name' => $fieldname, '@info' => print_r($form_state['input'], true)));
unset($form_state['input']['variety-sessions'][$fieldname]);
}
//create the form element for this timeslot //create the form element for this timeslot
$form['variety-sessions'][$fieldname] = array( $form['variety-sessions'][$fieldname] = array(
'#type' => 'select', '#type' => 'select',