summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis <6653109+artonge@users.noreply.github.com>2022-10-20 12:16:15 +0200
committerGitHub <noreply@github.com>2022-10-20 12:16:15 +0200
commit4045020519b9f161e7ea93cf26b42d807cc3e4e6 (patch)
tree0ae20ef828d6440afd74f66ce0abc6559bbd0ae0
parent88f930f48372d97d291024f5186c856a7cbe5d40 (diff)
parent8dcc5433864f95f0a88cfd2530003b076a8f02bb (diff)
Merge pull request #1389 from nextcloud/artonge/fix/share_album_content_fetching
Fix logic of share album content fetching
-rw-r--r--lib/Album/AlbumMapper.php2
-rw-r--r--lib/Controller/PreviewController.php4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/Album/AlbumMapper.php b/lib/Album/AlbumMapper.php
index 8cb7b6bb..66360a11 100644
--- a/lib/Album/AlbumMapper.php
+++ b/lib/Album/AlbumMapper.php
@@ -467,7 +467,7 @@ class AlbumMapper {
->leftJoin("a", "photos_albums_files", "p", $query->expr()->eq("a.album_id", "p.album_id"))
->where($query->expr()->eq('collaborator_id', $query->createNamedParameter($collaboratorId)))
->andWhere($query->expr()->eq('collaborator_type', $query->createNamedParameter($collaboratorType, IQueryBuilder::PARAM_INT)))
- ->andWhere($query->expr()->eq('file_id', $query->createNamedParameter($fileId)))
+ ->andWhere($query->expr()->eq('file_id', $query->createNamedParameter($fileId, IQueryBuilder::PARAM_INT)))
->groupBy('a.album_id')
->executeQuery()
->fetchAll();
diff --git a/lib/Controller/PreviewController.php b/lib/Controller/PreviewController.php
index d84ea879..2ad4e91a 100644
--- a/lib/Controller/PreviewController.php
+++ b/lib/Controller/PreviewController.php
@@ -101,7 +101,7 @@ class PreviewController extends Controller {
if (\count($nodes) === 0) {
$receivedAlbums = $this->albumMapper->getAlbumsForCollaboratorIdAndFileId($user->getUID(), AlbumMapper::TYPE_USER, $fileId);
- $receivedAlbums = array_udiff($checkedAlbums, $receivedAlbums, fn ($a, $b) => strcmp($a->getId(), $b->getId()));
+ $receivedAlbums = array_udiff($receivedAlbums, $checkedAlbums, fn ($a, $b) => strcmp($a->getId(), $b->getId()));
$nodes = $this->getFileIdForAlbums($fileId, $receivedAlbums);
$checkedAlbums = array_merge($checkedAlbums, $receivedAlbums);
}
@@ -110,7 +110,7 @@ class PreviewController extends Controller {
$userGroups = $this->groupManager->getUserGroupIds($user);
foreach ($userGroups as $groupId) {
$albumsForGroup = $this->albumMapper->getAlbumsForCollaboratorIdAndFileId($groupId, AlbumMapper::TYPE_GROUP, $fileId);
- $albumsForGroup = array_udiff($checkedAlbums, $albumsForGroup, fn ($a, $b) => strcmp($a->getId(), $b->getId()));
+ $albumsForGroup = array_udiff($albumsForGroup, $checkedAlbums, fn ($a, $b) => strcmp($a->getId(), $b->getId()));
$nodes = $this->getFileIdForAlbums($fileId, $albumsForGroup);
$checkedAlbums = array_merge($checkedAlbums, $receivedAlbums);
if (\count($nodes) !== 0) {