Skip to content

Commit 3d6b49a

Browse files
author
Mastiuhin Olexandr
committed
MC-29988: [On Pre] Wishlist scope issue 404
1 parent 5ad40fa commit 3d6b49a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

app/code/Magento/Wishlist/Controller/Index/Plugin.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Framework\App\Config\ScopeConfigInterface;
1111
use Magento\Framework\App\RequestInterface;
1212
use Magento\Framework\App\Response\RedirectInterface;
13+
use Magento\Store\Model\ScopeInterface;
1314

1415
/**
1516
* Wishlist plugin before dispatch
@@ -89,7 +90,7 @@ public function beforeDispatch(\Magento\Framework\App\ActionInterface $subject,
8990
$this->messageManager->addErrorMessage(__('You must login or register to add items to your wishlist.'));
9091
}
9192
}
92-
if (!$this->config->isSetFlag('wishlist/general/active')) {
93+
if (!$this->config->isSetFlag('wishlist/general/active', ScopeInterface::SCOPE_STORES)) {
9394
throw new NotFoundException(__('Page not found.'));
9495
}
9596
}

app/code/Magento/Wishlist/Test/Unit/Controller/Index/PluginTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@
66

77
namespace Magento\Wishlist\Test\Unit\Controller\Index;
88

9+
use Magento\Store\Model\ScopeInterface;
10+
911
/**
1012
* Test for wishlist plugin before dispatch
13+
*
14+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1115
*/
1216
class PluginTest extends \PHPUnit\Framework\TestCase
1317
{
@@ -175,7 +179,7 @@ public function testBeforeDispatch()
175179
$this->config
176180
->expects($this->once())
177181
->method('isSetFlag')
178-
->with('wishlist/general/active')
182+
->with('wishlist/general/active', ScopeInterface::SCOPE_STORES)
179183
->willReturn(false);
180184

181185
$this->getPlugin()->beforeDispatch($indexController, $this->request);

0 commit comments

Comments
 (0)