Skip to content

Commit

Permalink
fix: Get Proper Node object when creating GroupVersion
Browse files Browse the repository at this point in the history
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv authored and backportbot[bot] committed Jun 21, 2024
1 parent f711294 commit 62d34f1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/Versions/VersionsBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,18 @@ private function getVersionsForFileFromDB(FileInfo $fileInfo, IUser $user, int $
/** @var Folder */
$folder = $this->appFolder->get((string)$folderId);
$file = $folder->get($fileInfo->getInternalPath());
/** @var Folder */
$groupFolder = $this->rootFolder->get('/__groupfolders/' . $folderId);

$versionEntities = $this->groupVersionsMapper->findAllVersionsForFileId($fileInfo->getId());
$mappedVersions = array_map(
function (GroupVersionEntity $versionEntity) use ($versionsFolder, $mountPoint, $file, $fileInfo, $user, $folderId) {
function (GroupVersionEntity $versionEntity) use ($versionsFolder, $mountPoint, $file, $fileInfo, $user, $folderId, $groupFolder) {
if ($fileInfo->getMtime() === $versionEntity->getTimestamp()) {
$versionFile = $file;
if ($fileInfo instanceof File) {
$versionFile = $fileInfo;
} else {
$versionFile = $groupFolder->get($fileInfo->getInternalPath());
}
} else {
try {
$versionFile = $versionsFolder->get((string)$versionEntity->getTimestamp());
Expand Down

0 comments on commit 62d34f1

Please # to comment.