fix diverse PHP 8.0 TypeErrors and ArgumentCountError in import/export

This commit is contained in:
Ralf Becker 2021-11-15 14:41:18 +01:00
parent 6d2a4bfc05
commit 3dd7af4aa5
3 changed files with 5 additions and 5 deletions

View File

@ -103,7 +103,7 @@ class addressbook_import_contacts_csv extends importexport_basic_import_csv {
if(!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 . ' ('.Api\Accounts::username($contact_owner) . ')',
$contact_owner . ' (' . (is_numeric($contact_owner) ? Api\Accounts::username($contact_owner) : $contact_owner) . ')',
Api\Accounts::username($this->user)
);
$contact_owner = 'personal';

View File

@ -108,13 +108,13 @@ class addressbook_wizard_import_contacts_csv extends importexport_wizard_basic_i
{
$content['msg'] = $this->steps['wizard_step60'];
$content['step'] = 'wizard_step60';
if(!array_key_exists($content['contact_owner']) && $content['plugin_options']) {
if(!array_key_exists('contact_owner', $content) && $content['plugin_options']) {
$content['contact_owner'] = $content['plugin_options']['contact_owner'];
}
if(!array_key_exists($content['owner_from_csv']) && $content['plugin_options']) {
if(!array_key_exists('owner_from_csv', $content) && $content['plugin_options']) {
$content['owner_from_csv'] = $content['plugin_options']['owner_from_csv'];
}
if(!array_key_exists($content['change_owner']) && $content['plugin_options']) {
if(!array_key_exists('change_owner', $content) && $content['plugin_options']) {
$content['change_owner'] = $content['plugin_options']['change_owner'];
}

View File

@ -426,7 +426,7 @@ class importexport_wizard_basic_import_csv
$sel_options['action'] = $this->actions;
// Make at least 1 (empty) conditions
$j = count($content['conditions']);
$j = count($content['conditions'] ?? []);
while ($j < 1)
{
$content['conditions'][] = array(