File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments