fix hidden field in form

This commit is contained in:
Nathan Coad
2018-05-05 21:30:29 +10:00
parent 19d6b1d432
commit 7dea27104b

View File

@@ -651,6 +651,12 @@ function booking_variety_regn_edit_form($node, &$form_state, $nid)
$timeslot_result = $timeslot_query->execute(); $timeslot_result = $timeslot_query->execute();
// --- Form starts here --- // --- Form starts here ---
//add the person nid to the form in a hidden field so we can update the right person later
$form['nid'] = array (
'#type' => 'hidden',
'#value' => $nid,
);
//define the form for variety session configuration if we're not deleting a session //define the form for variety session configuration if we're not deleting a session
if(!isset($form_state['storage']['confirm'])) { if(!isset($form_state['storage']['confirm'])) {
$form[] = array ( $form[] = array (
@@ -660,11 +666,7 @@ function booking_variety_regn_edit_form($node, &$form_state, $nid)
), ),
); );
//add this to the form in a hidden field so we can update the right event
$form['nid'] = array (
'#type' => 'hidden',
'#value' => $nid,
);
$form['variety-sessions'] = array( $form['variety-sessions'] = array(
'#type' => 'fieldset', '#type' => 'fieldset',
@@ -703,7 +705,7 @@ function booking_variety_regn_edit_form($node, &$form_state, $nid)
); );
} //end checking for delete confirmation } //end checking for delete confirmation
else { else {
return confirm_form($form, "Are you sure you wish to delete all variety session registrations for id " . $nid . "?", return confirm_form($form, "Are you sure you wish to delete all variety session registrations for person id " . $nid . "?",
current_path(), NULL, "Delete Session"); current_path(), NULL, "Delete Session");
} }
} }