Skip to content

Commit e373d46

Browse files
committed
Merge remote-tracking branch 'mainline/2.2-develop' into MAGETWO-80201
2 parents aafcc0b + 91765ea commit e373d46

File tree

6 files changed

+86
-47
lines changed

6 files changed

+86
-47
lines changed

app/code/Magento/Backend/Controller/Adminhtml/Noroute/Index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function execute()
4141
{
4242
/** @var \Magento\Backend\Model\View\Result\Page $resultPage */
4343
$resultPage = $this->resultPageFactory->create();
44-
$resultPage->setStatusHeader(404, '1.1', 'Forbidden');
44+
$resultPage->setStatusHeader(404, '1.1', 'Not Found');
4545
$resultPage->setHeader('Status', '404 File not found');
4646
$resultPage->addHandle('adminhtml_noroute');
4747
return $resultPage;

app/code/Magento/Checkout/view/frontend/web/js/region-updater.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ define([
206206
regionInput.removeClass('required-entry');
207207
}
208208

209-
regionList.removeClass('required-entry').hide();
209+
regionList.removeClass('required-entry').prop('disabled', 'disabled').hide();
210210
regionInput.show();
211211
label.attr('for', regionInput.attr('id'));
212212
}

app/code/Magento/Search/view/frontend/web/form-mini.js

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -286,46 +286,50 @@ define([
286286
$.getJSON(this.options.url, {
287287
q: value
288288
}, $.proxy(function (data) {
289-
$.each(data, function (index, element) {
290-
var html;
291-
292-
element.index = index;
293-
html = template({
294-
data: element
289+
if (data.length) {
290+
$.each(data, function (index, element) {
291+
var html;
292+
293+
element.index = index;
294+
html = template({
295+
data: element
296+
});
297+
dropdown.append(html);
295298
});
296-
dropdown.append(html);
297-
});
298-
this.responseList.indexList = this.autoComplete.html(dropdown)
299-
.css(clonePosition)
300-
.show()
301-
.find(this.options.responseFieldElements + ':visible');
302-
303-
this._resetResponseList(false);
304-
this.element.removeAttr('aria-activedescendant');
305-
306-
if (this.responseList.indexList.length) {
307-
this._updateAriaHasPopup(true);
308-
} else {
309-
this._updateAriaHasPopup(false);
310-
}
311299

312-
this.responseList.indexList
313-
.on('click', function (e) {
314-
this.responseList.selected = $(e.currentTarget);
315-
this.searchForm.trigger('submit');
316-
}.bind(this))
317-
.on('mouseenter mouseleave', function (e) {
318-
this.responseList.indexList.removeClass(this.options.selectClass);
319-
$(e.target).addClass(this.options.selectClass);
320-
this.responseList.selected = $(e.target);
321-
this.element.attr('aria-activedescendant', $(e.target).attr('id'));
322-
}.bind(this))
323-
.on('mouseout', function (e) {
324-
if (!this._getLastElement() && this._getLastElement().hasClass(this.options.selectClass)) {
325-
$(e.target).removeClass(this.options.selectClass);
326-
this._resetResponseList(false);
327-
}
328-
}.bind(this));
300+
this.responseList.indexList = this.autoComplete.html(dropdown)
301+
.css(clonePosition)
302+
.show()
303+
.find(this.options.responseFieldElements + ':visible');
304+
305+
this._resetResponseList(false);
306+
this.element.removeAttr('aria-activedescendant');
307+
308+
if (this.responseList.indexList.length) {
309+
this._updateAriaHasPopup(true);
310+
} else {
311+
this._updateAriaHasPopup(false);
312+
}
313+
314+
this.responseList.indexList
315+
.on('click', function (e) {
316+
this.responseList.selected = $(e.currentTarget);
317+
this.searchForm.trigger('submit');
318+
}.bind(this))
319+
.on('mouseenter mouseleave', function (e) {
320+
this.responseList.indexList.removeClass(this.options.selectClass);
321+
$(e.target).addClass(this.options.selectClass);
322+
this.responseList.selected = $(e.target);
323+
this.element.attr('aria-activedescendant', $(e.target).attr('id'));
324+
}.bind(this))
325+
.on('mouseout', function (e) {
326+
if (!this._getLastElement() &&
327+
this._getLastElement().hasClass(this.options.selectClass)) {
328+
$(e.target).removeClass(this.options.selectClass);
329+
this._resetResponseList(false);
330+
}
331+
}.bind(this));
332+
}
329333
}, this));
330334
} else {
331335
this._resetResponseList(true);

app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ define([
244244
],
245245
'stripped-min-length': [
246246
function (value, param) {
247-
return value.length >= param;
247+
return _.isUndefined(value) || value.length === 0 || utils.stripHtml(value).length >= param;
248248
},
249249
$.mage.__('Please enter at least {0} characters')
250250
],

setup/src/Magento/Setup/Console/Command/UpgradeCommand.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Setup\Console\Command;
77

88
use Magento\Deploy\Console\Command\App\ConfigImportCommand;
9+
use Magento\Framework\App\State as AppState;
910
use Magento\Framework\App\DeploymentConfig;
1011
use Magento\Framework\App\ObjectManager;
1112
use Magento\Framework\Setup\ConsoleLogger;
@@ -37,16 +38,25 @@ class UpgradeCommand extends AbstractSetupCommand
3738
*/
3839
private $deploymentConfig;
3940

41+
/**
42+
* @var AppState
43+
*/
44+
private $appState;
45+
4046
/**
4147
* Constructor
4248
*
4349
* @param InstallerFactory $installerFactory
4450
* @param DeploymentConfig $deploymentConfig
4551
*/
46-
public function __construct(InstallerFactory $installerFactory, DeploymentConfig $deploymentConfig = null)
47-
{
52+
public function __construct(
53+
InstallerFactory $installerFactory,
54+
DeploymentConfig $deploymentConfig = null,
55+
AppState $appState = null
56+
) {
4857
$this->installerFactory = $installerFactory;
4958
$this->deploymentConfig = $deploymentConfig ?: ObjectManager::getInstance()->get(DeploymentConfig::class);
59+
$this->appState = $appState ?: ObjectManager::getInstance()->get(AppState::class);
5060
parent::__construct();
5161
}
5262

@@ -90,7 +100,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
90100
$importConfigCommand->run($arrayInput, $output);
91101
}
92102

93-
if (!$keepGenerated) {
103+
if (!$keepGenerated && $this->appState->getMode() === AppState::MODE_PRODUCTION) {
94104
$output->writeln(
95105
'<info>Please re-run Magento compile command. Use the command "setup:di:compile"</info>'
96106
);

setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Setup\Test\Unit\Console\Command;
77

88
use Magento\Framework\App\DeploymentConfig;
9+
use Magento\Framework\App\State as AppState;
910
use Magento\Framework\Console\Cli;
1011
use Magento\Setup\Console\Command\UpgradeCommand;
1112
use Magento\Setup\Model\Installer;
@@ -29,11 +30,15 @@ class UpgradeCommandTest extends \PHPUnit\Framework\TestCase
2930
*/
3031
private $installerMock;
3132

33+
/**
34+
* @var AppState|\PHPUnit_Framework_MockObject_MockObject
35+
*/
36+
private $appStateMock;
37+
3238
/**
3339
* @var UpgradeCommand
3440
*/
3541
private $upgradeCommand;
36-
3742
/**
3843
* @var CommandTester
3944
*/
@@ -56,16 +61,24 @@ protected function setUp()
5661
$this->installerFactoryMock->expects($this->once())
5762
->method('create')
5863
->willReturn($this->installerMock);
64+
$this->appStateMock = $this->getMockBuilder(AppState::class)
65+
->disableOriginalConstructor()
66+
->getMock();
5967

60-
$this->upgradeCommand = new UpgradeCommand($this->installerFactoryMock, $this->deploymentConfigMock);
68+
$this->upgradeCommand = new UpgradeCommand(
69+
$this->installerFactoryMock,
70+
$this->deploymentConfigMock,
71+
$this->appStateMock
72+
);
6173
$this->commandTester = new CommandTester($this->upgradeCommand);
6274
}
6375

6476
/**
6577
* @dataProvider executeDataProvider
6678
*/
67-
public function testExecute($options, $expectedString = '')
79+
public function testExecute($options, $deployMode, $expectedString = '')
6880
{
81+
$this->appStateMock->method('getMode')->willReturn($deployMode);
6982
$this->installerMock->expects($this->at(0))
7083
->method('updateModulesSequence');
7184
$this->installerMock->expects($this->at(1))
@@ -85,11 +98,23 @@ public function executeDataProvider()
8598
return [
8699
[
87100
'options' => [],
101+
'deployMode' => \Magento\Framework\App\State::MODE_PRODUCTION,
88102
'expectedString' => 'Please re-run Magento compile command. Use the command "setup:di:compile"'
89103
. PHP_EOL
90104
],
91105
[
92106
'options' => ['--keep-generated' => true],
107+
'deployMode' => \Magento\Framework\App\State::MODE_PRODUCTION,
108+
'expectedString' => ''
109+
],
110+
[
111+
'options' => [],
112+
'deployMode' => \Magento\Framework\App\State::MODE_DEVELOPER,
113+
'expectedString' => ''
114+
],
115+
[
116+
'options' => [],
117+
'deployMode' => \Magento\Framework\App\State::MODE_DEFAULT,
93118
'expectedString' => ''
94119
],
95120
];

0 commit comments

Comments
 (0)