From 3dfdcee1934f0814ff96032f1a629539829be1b1 Mon Sep 17 00:00:00 2001 From: nathangray Date: Tue, 26 Mar 2019 11:26:41 -0600 Subject: [PATCH] Reset bo object data before each import to fix imports without ID went to the same object --- addressbook/inc/class.addressbook_import_contacts_csv.inc.php | 2 ++ infolog/inc/class.infolog_import_infologs_csv.inc.php | 4 ++++ timesheet/inc/class.timesheet_import_csv.inc.php | 3 +++ 3 files changed, 9 insertions(+) diff --git a/addressbook/inc/class.addressbook_import_contacts_csv.inc.php b/addressbook/inc/class.addressbook_import_contacts_csv.inc.php index fe4d6a7592..812a7108a1 100644 --- a/addressbook/inc/class.addressbook_import_contacts_csv.inc.php +++ b/addressbook/inc/class.addressbook_import_contacts_csv.inc.php @@ -130,6 +130,8 @@ class addressbook_import_contacts_csv extends importexport_basic_import_csv { */ protected function import_record(importexport_iface_egw_record &$record, &$import_csv) { + // Reset BO data for new record + $this->bocontacts->data = array(); // Set owner, unless it's supposed to come from CSV file if($this->definition->plugin_options['owner_from_csv'] && $record->owner) { diff --git a/infolog/inc/class.infolog_import_infologs_csv.inc.php b/infolog/inc/class.infolog_import_infologs_csv.inc.php index 2bee3c767b..dde32479d8 100644 --- a/infolog/inc/class.infolog_import_infologs_csv.inc.php +++ b/infolog/inc/class.infolog_import_infologs_csv.inc.php @@ -181,6 +181,10 @@ class infolog_import_infologs_csv implements importexport_iface_import_plugin { $success = false; + + // Reset BO data for new record + $this->boinfolog->data = array(); + // don't import empty records if( count( array_unique( $record ) ) < 2 ) continue; diff --git a/timesheet/inc/class.timesheet_import_csv.inc.php b/timesheet/inc/class.timesheet_import_csv.inc.php index cad0ce19e4..c0c795a77a 100644 --- a/timesheet/inc/class.timesheet_import_csv.inc.php +++ b/timesheet/inc/class.timesheet_import_csv.inc.php @@ -90,6 +90,9 @@ class timesheet_import_csv extends importexport_basic_import_csv */ protected function import_record(importexport_iface_egw_record &$record, &$import_csv) { + // Reset BO data for new record + $this->bo->data = array(); + // Automatically handle text Api\Categories without explicit Api\Translation foreach(array('ts_status','cat_id') as $field) {