From 8ff5f6f99f4e63830a2481ae37897b01872c7a0f Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 19 Dec 2012 20:21:51 +0000 Subject: [PATCH] Improve error messages when linking goes awry --- .../inc/class.importexport_import_csv.inc.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/importexport/inc/class.importexport_import_csv.inc.php b/importexport/inc/class.importexport_import_csv.inc.php index dd93b7e353..01fb6d2838 100755 --- a/importexport/inc/class.importexport_import_csv.inc.php +++ b/importexport/inc/class.importexport_import_csv.inc.php @@ -330,9 +330,11 @@ class importexport_import_csv implements importexport_iface_import_record { //, { $exact_count++; $app_id = $id; + continue; } + unset($results[$id]); } - if($exact_count != 1) + if($exact_count > 1) { $warnings[] = lang('Unable to link to %1 "%2"', lang($links[$name]), $record[$name]). @@ -340,9 +342,12 @@ class importexport_import_csv implements importexport_iface_import_record { //, $record[$name] = null; continue; } - $record[$name] = $app_id; + elseif ($exact_count == 1) + { + $record[$name] = $app_id; + } } - else if (count($results) == 0) + if (count($results) == 0) { $warnings[] = lang('Unable to link to %1 "%2"', lang($links[$name]), $record[$name]).