From bc0cee9a9e5f400aa8fb9a29a4c906de4fb1f181 Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Sat, 30 Jun 2018 14:46:57 +1000 Subject: [PATCH] fix data import not using nid --- booking.import_data.inc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/booking.import_data.inc b/booking.import_data.inc index 1fcb373..82494df 100644 --- a/booking.import_data.inc +++ b/booking.import_data.inc @@ -157,8 +157,8 @@ function booking_import_data_admin_submit($form, &$form_state) // Pre-process some data foreach($fields_to_import as $field) { //make sure to skip the nid field since we can't update that - if ($field == 'nid') { - //do nothing + if (in_array($field, $unique_fields)) { + //Don't add this identifier to the list of updates } //convert the booking status to the number used internally elseif ($field == 'booking_status') { @@ -205,10 +205,11 @@ function booking_import_data_admin_submit($form, &$form_state) } //handle study group processing - $update_text .= _booking_import_studygroup_info($record['nid'], $studygroups_update_array, $studygroup_roles_update_array); + if ($key == 'nid') { + $update_text .= _booking_import_studygroup_info($record['nid'], $studygroups_update_array, $studygroup_roles_update_array); + drupal_set_message(t("Updating record !nid as follows: !update", array('!nid' => $record['nid'], '!update' => $update_text))); + } - drupal_set_message(t("Updating record !nid as follows: !update", array('!nid' => $record['nid'], '!update' => $update_text))); - //$args = $query->getArguments(); /* watchdog('booking', "Update Query:
@info
Condition: @nid
Rows affected: @rows
Values:
@values
",