From 95f8c3d5573871b041a86fbaeb9783c8342ac009 Mon Sep 17 00:00:00 2001 From: Adam Serbinski Date: Thu, 26 Jan 2023 10:19:54 -0500 Subject: [PATCH] ShareByMailProvider: getAccessList: set both array keys 'public' and 'mail' To preserve prior behaviour where 'public' was set 'true' if there are any mail recipients. The 'mail' key will be an array of email recipients. Signed-off-by: Adam Serbinski --- apps/sharebymail/lib/ShareByMailProvider.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index 3704de4309f30..e7f1db25a9b8b 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -1108,6 +1108,7 @@ public function getAccessList($nodes, $currentAccess): array { )); $cursor = $qb->executeQuery(); + $public = $cursor->rowCount() > 0; $mail = []; while ($row = $cursor->fetch()) { if ($currentAccess === false) { @@ -1121,7 +1122,7 @@ public function getAccessList($nodes, $currentAccess): array { } $cursor->closeCursor(); - return ['public' => $mail]; + return ['public' => $public, 'mail' => $mail]; } public function getAllShares(): iterable {