change check for db query

This commit is contained in:
Nathan Coad
2018-01-14 11:36:58 +11:00
parent 51bf95dfeb
commit 18233ba6ee

View File

@@ -111,16 +111,16 @@ function travel_form($node, &$form_state, $db_node = NULL, $inserting = FALSE, $
//there's already info in $node so use that
if (!empty($db_node)) {
$data = $db_node;
watchdog('booking_debug', "<pre>Travel form not-empty node:\n@info</pre>", array('@info' => print_r( $data, true)));
watchdog('booking_debug', "<pre>Travel form loaded from travel page:\n@info</pre>", array('@info' => print_r( $data, true)));
}
//otherwise rely on the form state from the previous submission
else {
$data = $form_state['node'];
watchdog('booking_debug', "<pre>Travel form empty node:\n@info</pre>", array('@info' => print_r( $data, true)));
watchdog('booking_debug', "<pre>Travel form loaded directly:\n@info</pre>", array('@info' => print_r( $data, true)));
}
//get info from the database if we don't have it
if (! $data->booking_dietary) {
if (! $data->booking_partner_id) {
watchdog('booking_debug', "<pre>Travel form querying database for missing details</pre>");
$person = db_query("SELECT booking_dietary, booking_medical_conditions, booking_bf_gf_nid, booking_partner_id, booking_room_mate1 " .