improve attachment detection

This commit is contained in:
Nathan Coad
2018-06-17 04:42:30 +10:00
parent ea9ed2abf3
commit 181645ecfb

View File

@@ -424,10 +424,10 @@ function booking_manual_email_form_submit($form, &$form_state) {
$attachment = NULL;
$update_messages = array();
$checkboxes = $form_state['values']['table']; //$values['booking_price_active'];
watchdog('booking', 'Formstate when setting buttons: @info', array ('@info' => var_export($form_state['values'], TRUE)));
//watchdog('booking', 'Formstate when setting buttons: @info', array ('@info' => var_export($form_state['values'], TRUE)));
//watchdog('booking', 'Checkboxes when setting buttons: @info', array ('@info' => var_export($checkboxes, TRUE)));
if (isset($form_state['values']['booking-email-attachment'])) {
if (isset($form_state['values']['booking-email-attachment']) && $form_state['values']['booking-email-attachment'] != 0) {
$attachment = file_load($form_state['values']['booking-email-attachment']);
watchdog('booking_debug', 'File attachment detected: @info', array ('@info' => print_r($attachment, TRUE)));
// NOTE: Since we do nothing to save this file, it should get cleaned up by cron