Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/photos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis <6653109+artonge@users.noreply.github.com>2022-10-20 15:56:45 +0300
committerGitHub <noreply@github.com>2022-10-20 15:56:45 +0300
commitda098c12a786589e4945dd6078b20ccfd093edd4 (patch)
treede4b196a003552ce63b522579eb6019784e50d09
parentf1973b93a269c56ead59b75ef2fe2d599055af5a (diff)
parent576508c8ffa7a4ae7261c69c08c2157baf0e9f8d (diff)
Merge pull request #1408 from nextcloud/backport/stable25/1389
[stable25] 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) {