attempt fix

This commit is contained in:
Nathan Coad
2018-01-14 11:13:12 +11:00
parent fa383cb515
commit 7849265288

View File

@@ -68,7 +68,7 @@ function booking_travel_page()
); );
//actual form //actual form
$return_array[] = array( $return_array[] = array(
'form' => drupal_get_form('travel_form', true, $tokens) 'form' => drupal_get_form('travel_form', $node, true, $tokens)
); );
//text after form //text after form
/* /*
@@ -92,7 +92,7 @@ function booking_travel_page()
} }
//function travel_form($node, &$form_state, $inserting = FALSE, $node = NULL, $tokens = NULL) //function travel_form($node, &$form_state, $inserting = FALSE, $node = NULL, $tokens = NULL)
function travel_form($node, &$form_state, $inserting = FALSE, $tokens = NULL) function travel_form($node, &$form_state, $db_node = NULL, $inserting = FALSE, $tokens = NULL)
{ {
global $event; global $event;
date_default_timezone_set(date_default_timezone(FALSE)); date_default_timezone_set(date_default_timezone(FALSE));
@@ -109,14 +109,14 @@ function travel_form($node, &$form_state, $inserting = FALSE, $tokens = NULL)
); );
//there's already info in $node so use that //there's already info in $node so use that
if (!empty($node)) { if (!empty($db_node)) {
$data = $node; $data = $db_node;
watchdog('booking_debug', "<pre>Travel form not-empty node:\n@info</pre>", array('@info' => print_r( $node, true))); watchdog('booking_debug', "<pre>Travel form not-empty node:\n@info</pre>", array('@info' => print_r( $data, true)));
} }
//otherwise rely on the form state from the previous submission //otherwise rely on the form state from the previous submission
else { else {
$data = $form_state['node']; $data = $form_state['node'];
watchdog('booking_debug', "<pre>Travel form empty node:\n@info</pre>", array('@info' => print_r( $form_state, true))); watchdog('booking_debug', "<pre>Travel form empty node:\n@info</pre>", array('@info' => print_r( $data, true)));
} }
//get info about this person from the relevant node id //get info about this person from the relevant node id