Skip to content

Commit 6127765

Browse files
committed
Merge remote-tracking branch 'origin/BUG#AC-1285' into gl_pr_accessibility_release244_nov23_2021
2 parents 855d70b + a6cf190 commit 6127765

File tree

26 files changed

+346
-445
lines changed

26 files changed

+346
-445
lines changed

app/code/Magento/Backend/App/DefaultPath.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22
/**
3-
* Default application path for backend area
4-
*
53
* Copyright © Magento, Inc. All rights reserved.
64
* See COPYING.txt for license details.
75
*/
86
namespace Magento\Backend\App;
97

108
/**
9+
* Default application path for backend area
10+
*
1111
* @api
1212
* @since 100.0.2
1313
*/
@@ -24,7 +24,11 @@ class DefaultPath implements \Magento\Framework\App\DefaultPathInterface
2424
*/
2525
public function __construct(\Magento\Backend\App\ConfigInterface $config)
2626
{
27-
$pathParts = explode('/', $config->getValue('web/default/admin'));
27+
$pathConfigValue = $config->getValue('web/default/admin') ?? '';
28+
$pathParts = [];
29+
if ($pathConfigValue) {
30+
$pathParts = explode('/', $pathConfigValue);
31+
}
2832

2933
$this->_parts = [
3034
'area' => isset($pathParts[0]) ? $pathParts[0] : '',

app/code/Magento/Backend/Block/Widget/Button/SplitButton.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public function getToggleAttributesHtml()
168168
'title' => $title,
169169
'class' => join(' ', $classes),
170170
'disabled' => $disabled,
171-
'aria-label' => $this->getData('dropdown_button_aria_label') ?: '',
171+
'aria-label' => (string)$this->getData('dropdown_button_aria_label'),
172172
];
173173
$this->_getDataAttributes(['mage-init' => '{"dropdown": {}}', 'toggle' => 'dropdown'], $attributes);
174174

app/code/Magento/Backend/view/adminhtml/templates/widget/tabshoriz.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use Magento\Framework\View\Helper\SecureHtmlRenderer;
1919
<?php foreach ($tabs as $_tab): ?>
2020
<?php $tabId = $block->getTabId($_tab) ?>
2121
<?php $_tabClass = 'tab-item-link ' . $block->getTabClass($_tab) . ' ' .
22-
(preg_match('/\s?ajax\s?/', $_tab->getClass()) ? 'notloaded' : '') ?>
22+
($_tab->getClass() !== null ? (preg_match('/\s?ajax\s?/', $_tab->getClass()) ? 'notloaded' : '') : '') ?>
2323
<?php $_tabType = (!preg_match('/\s?ajax\s?/', $_tabClass) && $block->getTabUrl($_tab) != '#') ? 'link' : '' ?>
2424
<?php $_tabHref = $block->getTabUrl($_tab) == '#' ?
2525
'#' . $tabId . '_content' :

app/code/Magento/Deploy/Model/Plugin/ConfigChangeDetector.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Magento\Deploy\Model\Plugin;
88

99
use Magento\Deploy\Model\DeploymentConfig\ChangeDetector;
10+
use Magento\Framework\App\DeploymentConfig;
1011
use Magento\Framework\App\FrontControllerInterface;
1112
use Magento\Framework\App\RequestInterface;
1213
use Magento\Framework\Exception\LocalizedException;
@@ -20,19 +21,26 @@
2021
*/
2122
class ConfigChangeDetector
2223
{
24+
private const DEPLOYMENT_BLUE_GREEN_ENABLED = 'deployment/blue_green/enabled';
25+
2326
/**
2427
* Configuration data changes detector.
2528
*
2629
* @var ChangeDetector
2730
*/
2831
private $changeDetector;
2932

33+
/** @var DeploymentConfig */
34+
private $deploymentConfig;
35+
3036
/**
31-
* @param ChangeDetector $changeDetector configuration data changes detector
37+
* @param ChangeDetector $changeDetector
38+
* @param DeploymentConfig $deploymentConfig
3239
*/
33-
public function __construct(ChangeDetector $changeDetector)
40+
public function __construct(ChangeDetector $changeDetector, DeploymentConfig $deploymentConfig)
3441
{
3542
$this->changeDetector = $changeDetector;
43+
$this->deploymentConfig = $deploymentConfig;
3644
}
3745

3846
/**
@@ -46,7 +54,9 @@ public function __construct(ChangeDetector $changeDetector)
4654
*/
4755
public function beforeDispatch(FrontControllerInterface $subject, RequestInterface $request)
4856
{
49-
if ($this->changeDetector->hasChanges()) {
57+
if (!$this->deploymentConfig->get(self::DEPLOYMENT_BLUE_GREEN_ENABLED)
58+
&& $this->changeDetector->hasChanges()
59+
) {
5060
throw new LocalizedException(
5161
__(
5262
'The configuration file has changed.'

app/code/Magento/Deploy/Test/Unit/Model/Plugin/ConfigChangeDetectorTest.php

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use Magento\Deploy\Model\DeploymentConfig\ChangeDetector;
1111
use Magento\Deploy\Model\Plugin\ConfigChangeDetector;
12+
use Magento\Framework\App\DeploymentConfig;
1213
use Magento\Framework\App\FrontControllerInterface;
1314
use Magento\Framework\App\RequestInterface;
1415
use PHPUnit\Framework\MockObject\MockObject;
@@ -36,6 +37,11 @@ class ConfigChangeDetectorTest extends TestCase
3637
*/
3738
private $requestMock;
3839

40+
/**
41+
* @var DeploymentConfig|mixed|MockObject
42+
*/
43+
private $deploymentConfig;
44+
3945
/**
4046
* @return void
4147
*/
@@ -48,8 +54,14 @@ protected function setUp(): void
4854
->getMockForAbstractClass();
4955
$this->requestMock = $this->getMockBuilder(RequestInterface::class)
5056
->getMockForAbstractClass();
57+
$this->deploymentConfig =$this->getMockBuilder(DeploymentConfig::class)
58+
->disableOriginalConstructor()
59+
->getMock();
5160

52-
$this->configChangeDetectorPlugin = new ConfigChangeDetector($this->changeDetectorMock);
61+
$this->configChangeDetectorPlugin = new ConfigChangeDetector(
62+
$this->changeDetectorMock,
63+
$this->deploymentConfig
64+
);
5365
}
5466

5567
/**
@@ -65,8 +77,6 @@ public function testBeforeDispatchWithoutException()
6577

6678
/**
6779
* @return void
68-
* @codingStandardsIgnoreStart
69-
* @codingStandardsIgnoreEnd
7080
*/
7181
public function testBeforeDispatchWithException()
7282
{
@@ -80,4 +90,13 @@ public function testBeforeDispatchWithException()
8090
->willReturn(true);
8191
$this->configChangeDetectorPlugin->beforeDispatch($this->frontControllerMock, $this->requestMock);
8292
}
93+
94+
public function testBeforeDispatchWithBlueGreen()
95+
{
96+
$this->deploymentConfig->expects($this->atLeastOnce())
97+
->method('get')
98+
->with('deployment/blue_green/enabled')
99+
->willReturn(1);
100+
$this->configChangeDetectorPlugin->beforeDispatch($this->frontControllerMock, $this->requestMock);
101+
}
83102
}

app/code/Magento/Eav/Model/Entity/Type.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ public function getValueTablePrefix()
303303
*/
304304
public function getEntityTablePrefix()
305305
{
306-
$tablePrefix = trim($this->_data['value_table_prefix']);
306+
$tablePrefix = isset($this->_data['value_table_prefix']) ? trim($this->_data['value_table_prefix']) : '';
307307

308308
if (empty($tablePrefix)) {
309309
$tablePrefix = $this->getEntityTable();

app/code/Magento/Ui/Component/Control/SplitButton.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public function getToggleAttributesHtml()
165165
'title' => $title,
166166
'class' => join(' ', $classes),
167167
'disabled' => $disabled,
168-
'aria-label' => $this->getData('dropdown_button_aria_label') ?: '',
168+
'aria-label' => (string)$this->getData('dropdown_button_aria_label'),
169169
];
170170
$this->getDataAttributes(['mage-init' => '{"dropdown": {}}', 'toggle' => 'dropdown'], $attributes);
171171

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@
8888
"magento/magento-coding-standard": "*",
8989
"magento/magento2-functional-testing-framework": "^3.7",
9090
"pdepend/pdepend": "~2.10.0",
91-
"phpcompatibility/php-compatibility": "^9.3",
9291
"phpmd/phpmd": "^2.9.1",
9392
"phpstan/phpstan": "~1.1.0",
9493
"phpunit/phpunit": "~9.5.0",

composer.lock

Lines changed: 69 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/PhpCompatibility.php

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)