Skip to content

Commit 9a23f2d

Browse files
committed
ACP2E-2015: Customizable Option Image link is broken
1 parent 7c7461a commit 9a23f2d

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

app/code/Magento/Sales/Controller/Download/DownloadCustomOption.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ class DownloadCustomOption extends \Magento\Framework\App\Action\Action implemen
2929
/**
3030
* @var \Magento\Framework\Unserialize\Unserialize
3131
* @deprecated 101.0.0
32+
* @deprecated No longer used
33+
* @see $serializer
3234
*/
3335
protected $unserialize;
3436

@@ -106,7 +108,7 @@ public function execute()
106108
if ($this->getRequest()->getParam('key') != $info['secret_key']) {
107109
return $resultForward->forward('noroute');
108110
}
109-
$this->download->downloadFile($info);
111+
return $this->download->createResponse($info);
110112
} catch (\Exception $e) {
111113
return $resultForward->forward('noroute');
112114
}

app/code/Magento/Sales/Model/Download.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,22 @@ public function __construct(
6767
* @param array $info
6868
* @return void
6969
* @throws \Exception
70+
* @deprecated No longer recommended
71+
* @see createResponse()
7072
*/
7173
public function downloadFile($info)
74+
{
75+
$this->createResponse($info);
76+
}
77+
78+
/**
79+
* Returns a file response
80+
*
81+
* @param array $info
82+
* @return \Magento\Framework\App\ResponseInterface
83+
* @throws \Exception
84+
*/
85+
public function createResponse($info)
7286
{
7387
$relativePath = $info['order_path'];
7488
if (!$this->_isCanProcessed($relativePath)) {
@@ -80,7 +94,7 @@ public function downloadFile($info)
8094
);
8195
}
8296
}
83-
$this->_fileFactory->create(
97+
return $this->_fileFactory->create(
8498
$info['title'],
8599
['value' => $this->_rootDir->getRelativePath($relativePath), 'type' => 'filename'],
86100
$this->rootDirBasePath,

0 commit comments

Comments
 (0)