From 8e7c09c905810f2610c1d1475ebe029b450c44cc Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 31 Aug 2023 08:57:46 -0600 Subject: [PATCH] Fix some incorrect / unwanted import warnings --- addressbook/inc/class.addressbook_import_contacts_csv.inc.php | 2 +- importexport/inc/class.importexport_import_csv.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addressbook/inc/class.addressbook_import_contacts_csv.inc.php b/addressbook/inc/class.addressbook_import_contacts_csv.inc.php index e7dbf0a17b..d670820bcf 100644 --- a/addressbook/inc/class.addressbook_import_contacts_csv.inc.php +++ b/addressbook/inc/class.addressbook_import_contacts_csv.inc.php @@ -100,7 +100,7 @@ class addressbook_import_contacts_csv extends importexport_basic_import_csv { $definition->plugin_options['contact_owner'] : $this->user; // Check to make sure target addressbook is valid - if(!in_array($contact_owner, array_keys($this->bocontacts->get_addressbooks(Api\Acl::ADD)))) + if($contact_owner != 'personal' && !in_array($contact_owner, array_keys($this->bocontacts->get_addressbooks(Api\Acl::ADD)))) { $this->warnings[0] = lang("Unable to import into %1, using %2", $contact_owner . ' (' . (is_numeric($contact_owner) ? Api\Accounts::username($contact_owner) : $contact_owner) . ')', diff --git a/importexport/inc/class.importexport_import_csv.inc.php b/importexport/inc/class.importexport_import_csv.inc.php index acd3cd6da8..8c4ec19f91 100755 --- a/importexport/inc/class.importexport_import_csv.inc.php +++ b/importexport/inc/class.importexport_import_csv.inc.php @@ -358,7 +358,7 @@ class importexport_import_csv implements importexport_iface_import_record { //, if ($record[$name]) { // Automatically handle text owner without explicit translation $new_owner = importexport_helper_functions::account_name2id($record[$name]); - if(!is_array($new_owner) || count($new_owner) != count(explode(',', $record[$name]))) + if(!$new_owner || is_array($record[$name]) && count($record[$name]) || $record[$name]) { // Unable to parse value into account $warnings[] = $name . ': ' .lang('%1 is not a known user or group', $record[$name]);