From 97865e0635b20818acb7f834b304c606443d1aab Mon Sep 17 00:00:00 2001 From: Raul Ferreira Date: Sun, 16 Jul 2023 00:17:21 +0200 Subject: [PATCH] fix shares_find --- .../Functions/Nextcloud/Shares_Find.php | 20 +++++++++++++------ tests/integration/config/behat.yml | 6 +++--- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/lib/Interpreter/Functions/Nextcloud/Shares_Find.php b/lib/Interpreter/Functions/Nextcloud/Shares_Find.php index 132b52d..4bea32e 100644 --- a/lib/Interpreter/Functions/Nextcloud/Shares_Find.php +++ b/lib/Interpreter/Functions/Nextcloud/Shares_Find.php @@ -80,14 +80,22 @@ public function run($nodeData=null, $shareTypes=null): array { $shareObjects = []; $homeFolder = $this->getHomeFolder(); foreach ($shareTypes as $shareType) { - $shares = $this->shareManager->getSharesBy($user->getUID(), $shareType, $node, false, -1, 0); - foreach ($shares as $share) { - $shareObjects[] = $this->serializeShare($share, $homeFolder); + try { + $shares = $this->shareManager->getSharesBy($user->getUID(), $shareType, $node, false, -1, 0); + foreach ($shares as $share) { + $shareObjects[] = $this->serializeShare($share, $homeFolder); + } + } catch(\Throwable $e) { + continue; } - $shares = $this->shareManager->getSharedWith($user->getUID(), $shareType, $node, false, -1, 0); - foreach ($shares as $share) { - $shareObjects[] = $this->serializeShare($share, $homeFolder); + try { + $shares = $this->shareManager->getSharedWith($user->getUID(), $shareType, $node, -1, 0); + foreach ($shares as $share) { + $shareObjects[] = $this->serializeShare($share, $homeFolder); + } + } catch(\Throwable $e) { + continue; } } return $shareObjects; diff --git a/tests/integration/config/behat.yml b/tests/integration/config/behat.yml index b773ca1..2305c93 100644 --- a/tests/integration/config/behat.yml +++ b/tests/integration/config/behat.yml @@ -7,9 +7,9 @@ default: - '%paths.base%/../features' contexts: - FeatureContext: - baseUrl: 'http://nextcloud.local/index.php' - remoteUrl: 'http://nextcloud.local/remote.php' - ocsUrl: 'http://nextcloud.local/ocs/v2.php' + baseUrl: 'http://localhost/server/index.php' + remoteUrl: 'http://localhost/server/remote.php' + ocsUrl: 'http://localhost/server/ocs/v2.php' ci: suites: