Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@

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;
use Magento\Framework\Controller\Result\ForwardFactory;

/**
* 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
Expand Down Expand Up @@ -95,10 +97,11 @@ 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 || !$productOption->getId() || $productOption->getType() != 'file') {
if ($productOption->getId() && $productOption->getType() != 'file') {
return $resultForward->forward('noroute');
}

Expand Down