From aff52e4349fb4331bbca010b02a83608b3d5ed4c Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Thu, 7 Sep 2017 16:03:18 +1000 Subject: [PATCH] bugfix --- booking.helper.inc | 7 ++++++- booking.regn_form.inc | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/booking.helper.inc b/booking.helper.inc index a577d87..df4b892 100644 --- a/booking.helper.inc +++ b/booking.helper.inc @@ -1316,8 +1316,13 @@ function _booking_details_email_summary($node) { $rows[] = t('Name: !first !last', array('!first' => $node->booking_firstname, '!last' => $node->booking_lastname)); $rows[] = t('Gender: !gender', array('!gender' => $node->booking_gender == 'M' ? 'Male' : 'Female')); $rows[] = t('Date of birth: !dob', array('!dob' => _booking_convert_ts($node->booking_dob)->format('d/m/Y'))); + if (variable_get('booking_enable_earlyaccess_codes', 0) == 1) { - $rows[] = array(t('Early Access Code:'), t('!code', array('!code' => $node->booking_earlyaccess_code))); + //look up the actual code since the booking_person node available at this time only has the primary key for that table + $earlyaccess_query = db_query("SELECT booking_earlyaccess_code FROM {booking_earlyaccess_codes} where cid = :code", + array(':code' => $values['booking_earlyaccess_code_id'])) + ->fetchObject(); + $rows[] = array(t('Early Access Code:'), t('!code', array('!code' => $earlyaccess_query->booking_earlyaccess_code))); } /* diff --git a/booking.regn_form.inc b/booking.regn_form.inc index 25eb545..11760f4 100644 --- a/booking.regn_form.inc +++ b/booking.regn_form.inc @@ -1344,6 +1344,7 @@ function booking_form_submit($form, &$form_state) $node->booking_skills_other_details = empty($values['booking_skills_other_details']) ? 'N/A' : $values['booking_skills_other_details']; $node->booking_earlyaccess_code_id = empty($values['booking_earlyaccess_code']) ? '' : $earlyaccess_query->cid; $node->booking_song_choice = empty($values['booking_song_choice']) ? '' : $values['booking_song_choice']; + $node->booking_freestyle_text = empty($values['booking_freestyle_text']) ? '' : $values['booking_freestyle_text']; //remove newlines from these fields so the CSV output doesn't get messed up $medical = empty($values['booking_medical_conditions']) ? 'N/A' : $values['booking_medical_conditions'];