From 5efb73a5da37c2bd58d8b98517bcc8636d2698fb Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Fri, 2 Jun 2023 12:17:54 +0200 Subject: [PATCH] fix: use owner instead of owner_id to delete photos by owner Signed-off-by: Daniel Kesselberg --- lib/Album/AlbumMapper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Album/AlbumMapper.php b/lib/Album/AlbumMapper.php index 3c91353e6..6b98d8329 100644 --- a/lib/Album/AlbumMapper.php +++ b/lib/Album/AlbumMapper.php @@ -298,7 +298,7 @@ public function removeFileWithOwner(int $fileId, string $ownerId): void { $query = $this->connection->getQueryBuilder(); $albumsRows = $query->select('album_id') ->from("photos_albums_files") - ->where($query->expr()->eq("owner_id", $query->createNamedParameter($ownerId))) + ->where($query->expr()->eq("owner", $query->createNamedParameter($ownerId))) ->andWhere($query->expr()->eq("file_id", $query->createNamedParameter($fileId, IQueryBuilder::PARAM_INT))) ->executeQuery() ->fetchAll(); @@ -306,7 +306,7 @@ public function removeFileWithOwner(int $fileId, string $ownerId): void { // Remove any occurrence of fileId when owner is ownerId. $query = $this->connection->getQueryBuilder(); $query->delete("photos_albums_files") - ->where($query->expr()->eq("owner_id", $query->createNamedParameter($ownerId))) + ->where($query->expr()->eq("owner", $query->createNamedParameter($ownerId))) ->andWhere($query->expr()->eq("file_id", $query->createNamedParameter($fileId, IQueryBuilder::PARAM_INT))) ->executeStatement();