Skip to content

Commit db093b3

Browse files
committed
Merge branch '4.6'
2 parents d3e0394 + beece8c commit db093b3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/lib/MVC/Symfony/Controller/Content/DownloadController.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,14 @@ public function __construct(
5151
*/
5252
public function downloadBinaryFileByIdAction(Request $request, int $contentId, int $fieldId): BinaryStreamResponse
5353
{
54-
$content = $this->contentService->loadContent($contentId);
54+
$versionNo = $request->query->has('version') ? $request->query->getInt('version') : null;
55+
$language = $request->query->has('inLanguage') ? $request->query->get('inLanguage') : null;
56+
57+
$content = $this->contentService->loadContent(
58+
$contentId,
59+
$language !== null ? [$language] : null,
60+
$versionNo,
61+
);
5562
try {
5663
$field = $this->findFieldInContent($fieldId, $content);
5764
} catch (InvalidArgumentException $e) {

0 commit comments

Comments
 (0)