Reset bo object data before each import to fix imports without ID went to the same object

This commit is contained in:
nathangray 2019-03-26 11:26:41 -06:00
parent 3185b48c4a
commit 3dfdcee193
3 changed files with 9 additions and 0 deletions

View File

@ -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) {

View File

@ -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;

View File

@ -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)
{