From 28f90f85542fafd4b89dd8afaa46ffc342af2260 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 29 Feb 2012 17:24:42 +0000 Subject: [PATCH] Add current record to the end of errors / warnings --- infolog/inc/class.infolog_import_infologs_csv.inc.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/infolog/inc/class.infolog_import_infologs_csv.inc.php b/infolog/inc/class.infolog_import_infologs_csv.inc.php index 1a848e0423..f7b4651723 100644 --- a/infolog/inc/class.infolog_import_infologs_csv.inc.php +++ b/infolog/inc/class.infolog_import_infologs_csv.inc.php @@ -179,7 +179,8 @@ class infolog_import_infologs_csv implements importexport_iface_import_plugin { // Make sure type is valid if(!$record['info_type'] || $record['info_type'] && !$this->boinfolog->enums['type'][$record['info_type']]) { - $this->warnings[$import_csv->get_current_position()] .= lang('Unknown type: %1', $record['info_type']); + $this->warnings[$import_csv->get_current_position()] .= ($this->warnings[$import_csv->get_current_position()] ? "\n":''). + lang('Unknown type: %1', $record['info_type']); } // Set default status for type, if not specified @@ -270,6 +271,12 @@ class infolog_import_infologs_csv implements importexport_iface_import_plugin { $success = $this->action( 'insert', $record, $import_csv->get_current_position() ); } if($success) $count++; + if($this->warnings[$import_csv->get_current_position()]) { + $this->warnings[$import_csv->get_current_position()] .= "\nRecord:\n" .array2string($record); + } + if($this->errors[$import_csv->get_current_position()]) { + $this->errors[$import_csv->get_current_position()] .= "\nRecord:\n" .array2string($record); + } } return $count; }