From ffc6a533a422c514e653a3b8a49700f4bb94fad1 Mon Sep 17 00:00:00 2001 From: ralf Date: Wed, 3 Apr 2024 10:37:16 +0200 Subject: [PATCH] fix Argument #2 ($old) must be of type ?array, bool given --- api/src/Contacts.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/src/Contacts.php b/api/src/Contacts.php index 445c6e7767..71ac24ba14 100755 --- a/api/src/Contacts.php +++ b/api/src/Contacts.php @@ -913,7 +913,7 @@ class Contacts extends Contacts\Storage { if (!isset($contact['owner']) || !isset($contact['private'])) // owner/private not set on update, eg. SyncML { - if (($old = $this->read($contact['id']))) // --> try reading the old entry and set it from there + if (($old = $this->read($contact['id']) ?: null)) // --> try reading the old entry and set it from there { if(!isset($contact['owner'])) { @@ -1005,7 +1005,7 @@ class Contacts extends Contacts\Storage // Get old record for tracking changes if (!isset($old) && $isUpdate) { - $old = $this->read($contact['id']); + $old = $this->read($contact['id']) ?: null; } $to_write = $contact; // (non-admin) user editing his own account, make sure he does not change fields he is not allowed to (eg. via SyncML or xmlrpc) @@ -1086,7 +1086,7 @@ class Contacts extends Contacts\Storage if(empty($contact['account_id']) || $contact['account_id'] && $this->account_repository == 'sql') { if (!isset($this->tracking)) $this->tracking = new Contacts\Tracking($this); - $this->tracking->track($to_write, $old ?? null, null, $deleted); + $this->tracking->track($to_write, $old, null, $deleted); } // Notify linked apps about changes in the contact data