Skip to content

Commit f5c8add

Browse files
author
Oleksii Korshenko
authored
Merge pull request #1176 from magento-engcom/develop-prs
Public Pull Requests: #9859 #9820 #9778 #9430 #9670
2 parents de2308b + d846962 commit f5c8add

File tree

7 files changed

+147
-8
lines changed

7 files changed

+147
-8
lines changed

app/code/Magento/CatalogSearch/Model/Search/FilterMapper/TermDropdownStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function apply(
101101
'search_index.entity_id = %1$s.entity_id AND %1$s.attribute_id = %2$d AND %1$s.store_id = %3$d',
102102
$alias,
103103
$attribute->getId(),
104-
$this->storeManager->getWebsite()->getId()
104+
$this->storeManager->getStore()->getId()
105105
);
106106
$select->joinLeft(
107107
[$alias => $this->frontendResource->getMainTable()],

app/code/Magento/CatalogSearch/Test/Unit/Model/Search/FilterMapper/TermDropdownStrategyTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Magento\Framework\Search\Request\FilterInterface;
1212
use Magento\Store\Model\StoreManagerInterface;
1313
use Magento\Framework\App\Config\ScopeConfigInterface;
14-
use Magento\Store\Api\Data\WebsiteInterface;
14+
use Magento\Store\Api\Data\StoreInterface;
1515
use Magento\Framework\DB\Select;
1616
use Magento\Eav\Model\Config as EavConfig;
1717
use Magento\Catalog\Model\ResourceModel\Eav\Attribute;
@@ -85,7 +85,7 @@ public function testApply()
8585
$attribute = $this->getMockBuilder(Attribute::class)
8686
->disableOriginalConstructor()
8787
->getMock();
88-
$website = $this->getMockBuilder(WebsiteInterface::class)
88+
$store = $this->getMockBuilder(StoreInterface::class)
8989
->disableOriginalConstructor()
9090
->getMock();
9191

@@ -99,9 +99,9 @@ public function testApply()
9999
->method('getAttribute')
100100
->willReturn($attribute);
101101
$this->storeManager->expects($this->once())
102-
->method('getWebsite')
103-
->willReturn($website);
104-
$website->expects($this->once())
102+
->method('getStore')
103+
->willReturn($store);
104+
$store->expects($this->once())
105105
->method('getId')
106106
->willReturn(1);
107107
$attribute->expects($this->once())
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Developer\Console\Command;
8+
9+
use Symfony\Component\Console\Command\Command;
10+
use Symfony\Component\Console\Input\InputInterface;
11+
use Symfony\Component\Console\Output\OutputInterface;
12+
use Magento\Framework\App\Config\ConfigResource\ConfigInterface;
13+
14+
class TemplateHintsDisableCommand extends Command
15+
{
16+
/**
17+
* command name
18+
*/
19+
const COMMAND_NAME = 'dev:template-hints:disable';
20+
21+
/**
22+
* Success message
23+
*/
24+
const SUCCESS_MESSAGE = "Template hints disabled. Refresh cache types";
25+
26+
/**
27+
* @var ConfigInterface
28+
*/
29+
private $resourceConfig;
30+
31+
/**
32+
* Initialize dependencies.
33+
*
34+
* @param ConfigInterface $resourceConfig
35+
*/
36+
public function __construct(ConfigInterface $resourceConfig)
37+
{
38+
parent::__construct();
39+
$this->resourceConfig = $resourceConfig;
40+
}
41+
42+
/**
43+
* {@inheritdoc}
44+
*/
45+
protected function configure()
46+
{
47+
$this->setName(self::COMMAND_NAME)
48+
->setDescription('Disable frontend template hints. A cache flush might be required.');
49+
50+
parent::configure();
51+
}
52+
53+
/**
54+
* {@inheritdoc}
55+
* @throws \InvalidArgumentException
56+
*/
57+
protected function execute(InputInterface $input, OutputInterface $output)
58+
{
59+
$this->resourceConfig->saveConfig('dev/debug/template_hints_storefront', 0, 'default', 0);
60+
$output->writeln("<info>". self::SUCCESS_MESSAGE . "</info>");
61+
}
62+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Developer\Console\Command;
8+
9+
use Symfony\Component\Console\Command\Command;
10+
use Symfony\Component\Console\Input\InputInterface;
11+
use Symfony\Component\Console\Output\OutputInterface;
12+
use Magento\Framework\App\Config\ConfigResource\ConfigInterface;
13+
14+
class TemplateHintsEnableCommand extends Command
15+
{
16+
17+
/**
18+
* command name
19+
*/
20+
const COMMAND_NAME = 'dev:template-hints:enable';
21+
22+
/**
23+
* Success message
24+
*/
25+
const SUCCESS_MESSAGE = "Template hints enabled.";
26+
27+
/**
28+
* @var ConfigInterface
29+
*/
30+
private $resourceConfig;
31+
32+
/**
33+
* Initialize dependencies.
34+
*
35+
* @param ConfigInterface $resourceConfig
36+
*/
37+
public function __construct(ConfigInterface $resourceConfig)
38+
{
39+
parent::__construct();
40+
$this->resourceConfig = $resourceConfig;
41+
}
42+
43+
/**
44+
* {@inheritdoc}
45+
*/
46+
protected function configure()
47+
{
48+
$this->setName(self::COMMAND_NAME)
49+
->setDescription('Enable frontend template hints. A cache flush might be required.');
50+
51+
parent::configure();
52+
}
53+
54+
/**
55+
* {@inheritdoc}
56+
* @throws \InvalidArgumentException
57+
*/
58+
protected function execute(InputInterface $input, OutputInterface $output)
59+
{
60+
$this->resourceConfig->saveConfig('dev/debug/template_hints_storefront', 1, 'default', 0);
61+
$output->writeln("<info>". self::SUCCESS_MESSAGE . "</info>");
62+
}
63+
}

app/code/Magento/Developer/etc/di.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@
100100
<item name="dev_di_info" xsi:type="object">Magento\Developer\Console\Command\DiInfoCommand</item>
101101
<item name="dev_query_log_enable" xsi:type="object">Magento\Developer\Console\Command\QueryLogEnableCommand</item>
102102
<item name="dev_query_log_disable" xsi:type="object">Magento\Developer\Console\Command\QueryLogDisableCommand</item>
103+
<item name="dev_template_hints_disable" xsi:type="object">Magento\Developer\Console\Command\TemplateHintsDisableCommand</item>
104+
<item name="dev_template_hints_enable" xsi:type="object">Magento\Developer\Console\Command\TemplateHintsEnableCommand</item>
103105
</argument>
104106
</arguments>
105107
</type>

app/code/Magento/Integration/etc/adminhtml/system.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,18 @@
4848
<comment>Timeout for OAuth consumer credentials Post request within X seconds.</comment>
4949
</field>
5050
</group>
51+
<group id="authentication_lock" translate="label" type="text" sortOrder="400" showInDefault="1" showInWebsite="0" showInStore="0">
52+
<label>Authentication Locks</label>
53+
<field id="max_failures_count" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
54+
<label>Maximum Login Failures to Lock Out Account</label>
55+
<comment>Maximum Number of authentication failures to lock out account.</comment>
56+
</field>
57+
<field id="timeout" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
58+
<label>Lockout Time (seconds)</label>
59+
<comment>Period of time in seconds after which account will be unlocked.</comment>
60+
</field>
61+
</group>
62+
5163
</section>
5264
</system>
5365
</config>

app/code/Magento/Sales/Block/Order/View.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ class View extends \Magento\Framework\View\Element\Template
2727
protected $_coreRegistry = null;
2828

2929
/**
30-
* @var \Magento\Customer\Model\Session
30+
* @var \Magento\Framework\App\Http\Context
3131
*/
32-
protected $_customerSession;
32+
protected $httpContext;
3333

3434
/**
3535
* @var \Magento\Payment\Helper\Data

0 commit comments

Comments
 (0)