From c411bdac73def7fe95809616c5d3ada573808bbf Mon Sep 17 00:00:00 2001 From: Mahesh Singh Date: Thu, 17 Jan 2019 01:06:25 +0530 Subject: [PATCH 1/2] issue#20277 fixed for 2.3.x --- .../Magento/Sales/Controller/Download/DownloadCustomOption.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Controller/Download/DownloadCustomOption.php b/app/code/Magento/Sales/Controller/Download/DownloadCustomOption.php index 0deddd9fb6ec5..c966a6ea7a4d1 100644 --- a/app/code/Magento/Sales/Controller/Download/DownloadCustomOption.php +++ b/app/code/Magento/Sales/Controller/Download/DownloadCustomOption.php @@ -98,7 +98,7 @@ public function execute() )->load($optionId); } - if (!$productOption || !$productOption->getId() || $productOption->getType() != 'file') { + if ($productOption->getId() && $productOption->getType() != 'file') { return $resultForward->forward('noroute'); } From b4657f7981c9b9acd2a56388d628c75d6cd7fb2c Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Fri, 18 Jan 2019 17:09:59 +0200 Subject: [PATCH 2/2] ENGCOM-3887: Static and Unit tests fix. --- .../Sales/Controller/Download/DownloadCustomOption.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Sales/Controller/Download/DownloadCustomOption.php b/app/code/Magento/Sales/Controller/Download/DownloadCustomOption.php index c966a6ea7a4d1..d30839e96dccb 100644 --- a/app/code/Magento/Sales/Controller/Download/DownloadCustomOption.php +++ b/app/code/Magento/Sales/Controller/Download/DownloadCustomOption.php @@ -7,6 +7,7 @@ namespace Magento\Sales\Controller\Download; +use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\Framework\App\ObjectManager; use Magento\Framework\App\Action\Context; use Magento\Catalog\Model\Product\Type\AbstractType; @@ -14,9 +15,10 @@ /** * Class DownloadCustomOption + * * @package Magento\Sales\Controller\Download */ -class DownloadCustomOption extends \Magento\Framework\App\Action\Action +class DownloadCustomOption extends \Magento\Framework\App\Action\Action implements HttpGetActionInterface { /** * @var ForwardFactory @@ -95,7 +97,8 @@ public function execute() /** @var $productOption \Magento\Catalog\Model\Product\Option */ $productOption = $this->_objectManager->create( \Magento\Catalog\Model\Product\Option::class - )->load($optionId); + ); + $productOption->load($optionId); } if ($productOption->getId() && $productOption->getType() != 'file') {