From f98f5bea92f44aa357fe32a2185e90c684efaba0 Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 17 Dec 2018 11:09:45 -0700 Subject: [PATCH] Import/Export - Fix unneeded warning about 'Unable to link...' when no link fields specified --- .../inc/class.importexport_basic_import_csv.inc.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/importexport/inc/class.importexport_basic_import_csv.inc.php b/importexport/inc/class.importexport_basic_import_csv.inc.php index 430f56c8ed..a3b5a88bd2 100644 --- a/importexport/inc/class.importexport_basic_import_csv.inc.php +++ b/importexport/inc/class.importexport_basic_import_csv.inc.php @@ -335,15 +335,16 @@ abstract class importexport_basic_import_csv implements importexport_iface_impor { $id = $record->get_identifier(); - // Warn if there's no ID unless it's a dry_run because there probably won't be an ID then - if(!$this->dry_run && !$id) - { - $this->warnings[$import_csv->get_current_position()] .= "Unable to link, no identifier for record"; - return; - } foreach(self::$special_fields as $field => $desc) { if(!$record->$field) continue; + + // Warn if there's no ID unless it's a dry_run because there probably won't be an ID then + if(!$this->dry_run && !$id) + { + $this->warnings[$import_csv->get_current_position()] .= "Unable to link, no identifier for record"; + return; + } if(strpos($field, 'link') === 0) { list($app, $app_id) = explode(':', $record->$field,2);