Skip to content

Commit

Permalink
fix shares_find
Browse files Browse the repository at this point in the history
  • Loading branch information
Raudius committed Jul 15, 2023
1 parent 66cfb77 commit 97865e0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
20 changes: 14 additions & 6 deletions lib/Interpreter/Functions/Nextcloud/Shares_Find.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/config/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 97865e0

Please sign in to comment.