From d3a46f254fe6a63f0c2b89b9dc02b17d49bce06e Mon Sep 17 00:00:00 2001 From: jygaulier Date: Wed, 25 Oct 2023 19:34:25 +0200 Subject: [PATCH] fix test --- lib/Alchemy/Phrasea/Controller/Prod/ExportController.php | 4 ++-- lib/classes/set/export.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Alchemy/Phrasea/Controller/Prod/ExportController.php b/lib/Alchemy/Phrasea/Controller/Prod/ExportController.php index 0b47a076a2..6ccea28428 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/ExportController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/ExportController.php @@ -61,8 +61,8 @@ public function displayMultiExport(Request $request) $removeable_stamp = false; // true if at least one coll is "unstampable" $removeable_stamp_by_base = []; // unset: no stamp ; false: stamp not "unstampable" ; true: stamp "unstampable" - $colls_manageable = array_keys($this->getAclForConnectedUser()->get_granted_base([ACL::COLL_MANAGE])); - $dbox_manageable = array_keys($this->getAclForConnectedUser()->get_granted_sbas([ACL::BAS_MANAGE])); + $colls_manageable = array_keys($this->getAclForConnectedUser()->get_granted_base([ACL::COLL_MANAGE]) ?? []); + $dbox_manageable = array_keys($this->getAclForConnectedUser()->get_granted_sbas([ACL::BAS_MANAGE]) ?? []); foreach($download->get_elements() as $recordAdapter) { // check collection only once diff --git a/lib/classes/set/export.php b/lib/classes/set/export.php index 9795b99f1a..b72b80f9c8 100644 --- a/lib/classes/set/export.php +++ b/lib/classes/set/export.php @@ -457,8 +457,8 @@ public function prepare_export(User $user, Filesystem $filesystem, Array $wanted // remove stamp on this collection $stamp_by_base = []; // unset: no stamp ; false: stamp not "unstampable" ; true: stamp "unstampable" - $colls_manageable = array_keys($this->getAclForUser($user)->get_granted_base([ACL::COLL_MANAGE])); - $dbox_manageable = array_keys($this->getAclForUser($user)->get_granted_sbas([ACL::BAS_MANAGE])); + $colls_manageable = array_keys($this->getAclForUser($user)->get_granted_base([ACL::COLL_MANAGE]) ?? []); + $dbox_manageable = array_keys($this->getAclForUser($user)->get_granted_sbas([ACL::BAS_MANAGE]) ?? []); /** @var record_exportElement $download_element */ foreach ($this->elements as $download_element) {