From 76c9d370060d7da27126377eadd92746e9bf46eb Mon Sep 17 00:00:00 2001 From: Jonny Tischbein Date: Wed, 31 Oct 2018 21:20:44 +0100 Subject: [PATCH] Fix not working unarchive contact batch action --- src/Module/Contact.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Module/Contact.php b/src/Module/Contact.php index 89a9891917..db30075984 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -138,7 +138,7 @@ class Contact extends BaseModule $contacts_id = $_POST['contact_batch']; - $stmt = DBA::select('contact', ['id'], ['id' => $contacts_id, 'uid' => local_user(), 'self' => false]); + $stmt = DBA::select('contact', ['id', 'archive'], ['id' => $contacts_id, 'uid' => local_user(), 'self' => false]); $orig_records = DBA::toArray($stmt); $count_actions = 0; @@ -336,7 +336,7 @@ class Contact extends BaseModule private static function archiveContact($contact_id, $orig_record) { - $archived = (($orig_record['archive']) ? 0 : 1); + $archived = (defaults($orig_record, 'archive', '') ? 0 : 1); $r = DBA::update('contact', ['archive' => $archived], ['id' => $contact_id, 'uid' => local_user()]); return DBA::isResult($r);