Skip to content

Commit bdab8df

Browse files
committed
Merge remote-tracking branch 'mainline/2.3-develop' into mtf-eol-pr
2 parents e54dbc3 + 777b0b0 commit bdab8df

File tree

19 files changed

+600
-175
lines changed

19 files changed

+600
-175
lines changed

app/code/Magento/AuthorizenetAcceptjs/view/frontend/web/template/payment/authorizenet-acceptjs.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<button class="action primary checkout"
3636
type="submit"
3737
click="beforePlaceOrder"
38+
css="disabled: !isPlaceOrderActionAllowed()"
3839
attr="title: $t('Place Order')"
3940
>
4041
<span translate="'Place Order'"></span>

app/code/Magento/Config/Model/Config/Reader/Source/Deployed/SettingChecker.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
*/
66
namespace Magento\Config\Model\Config\Reader\Source\Deployed;
77

8-
use Magento\Config\Model\Config\Reader;
9-
use Magento\Framework\App\Config\ScopeConfigInterface;
10-
use Magento\Framework\App\DeploymentConfig;
11-
use Magento\Config\Model\Placeholder\PlaceholderInterface;
128
use Magento\Config\Model\Placeholder\PlaceholderFactory;
9+
use Magento\Config\Model\Placeholder\PlaceholderInterface;
1310
use Magento\Framework\App\Config\ScopeCodeResolver;
11+
use Magento\Framework\App\Config\ScopeConfigInterface;
12+
use Magento\Framework\App\DeploymentConfig;
1413

1514
/**
1615
* Class for checking settings that defined in config file
@@ -68,6 +67,12 @@ public function isReadOnly($path, $scope, $scopeCode = null)
6867
$config = $this->config->get($this->resolvePath($scope, $scopeCode) . "/" . $path);
6968
}
7069

70+
if (null === $config) {
71+
$config = $this->config->get(
72+
$this->resolvePath(ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null) . "/" . $path
73+
);
74+
}
75+
7176
return $config !== null;
7277
}
7378

@@ -78,7 +83,6 @@ public function isReadOnly($path, $scope, $scopeCode = null)
7883
*
7984
* @param string $path
8085
* @param string $scope
81-
* @param string $scopeCode
8286
* @param string|null $scopeCode
8387
* @return string|null
8488
* @since 100.1.2
@@ -97,9 +101,11 @@ public function getPlaceholderValue($path, $scope, $scopeCode = null)
97101
*/
98102
public function getEnvValue($placeholder)
99103
{
104+
// phpcs:disable Magento2.Security.Superglobal
100105
if ($this->placeholder->isApplicable($placeholder) && isset($_ENV[$placeholder])) {
101106
return $_ENV[$placeholder];
102107
}
108+
// phpcs:enable
103109

104110
return null;
105111
}

app/code/Magento/Config/Test/Unit/Model/Config/Reader/Source/Deployed/SettingCheckerTest.php

Lines changed: 80 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Config\Test\Unit\Model\Config\Reader\Source\Deployed;
78

8-
use Magento\Config\Model\Config\Reader;
99
use Magento\Config\Model\Config\Reader\Source\Deployed\SettingChecker;
10+
use Magento\Config\Model\Placeholder\PlaceholderFactory;
11+
use Magento\Config\Model\Placeholder\PlaceholderInterface;
1012
use Magento\Framework\App\Config;
1113
use Magento\Framework\App\DeploymentConfig;
12-
use Magento\Config\Model\Placeholder\PlaceholderInterface;
13-
use Magento\Config\Model\Placeholder\PlaceholderFactory;
1414

1515
/**
1616
* Test class for checking settings that defined in config file
@@ -71,15 +71,23 @@ public function setUp()
7171
* @param string $scopeCode
7272
* @param string|null $confValue
7373
* @param array $variables
74+
* @param array $configMap
7475
* @param bool $expectedResult
7576
* @dataProvider isReadonlyDataProvider
7677
*/
77-
public function testIsReadonly($path, $scope, $scopeCode, $confValue, array $variables, $expectedResult)
78-
{
79-
$this->placeholderMock->expects($this->once())
78+
public function testIsReadonly(
79+
$path,
80+
$scope,
81+
$scopeCode,
82+
$confValue,
83+
array $variables,
84+
array $configMap,
85+
$expectedResult
86+
) {
87+
$this->placeholderMock->expects($this->any())
8088
->method('isApplicable')
8189
->willReturn(true);
82-
$this->placeholderMock->expects($this->once())
90+
$this->placeholderMock->expects($this->any())
8391
->method('generate')
8492
->with($path, $scope, $scopeCode)
8593
->willReturn('SOME_PLACEHOLDER');
@@ -95,13 +103,18 @@ public function testIsReadonly($path, $scope, $scopeCode, $confValue, array $var
95103

96104
$this->configMock->expects($this->any())
97105
->method('get')
98-
->willReturnMap([
99-
[
100-
'system/' . $scope . "/" . ($scopeCode ? $scopeCode . '/' : '') . $path,
101-
null,
102-
$confValue
103-
],
104-
]);
106+
->willReturnMap(
107+
array_merge(
108+
[
109+
[
110+
'system/' . $scope . "/" . ($scopeCode ? $scopeCode . '/' : '') . $path,
111+
null,
112+
$confValue
113+
],
114+
],
115+
$configMap
116+
)
117+
);
105118

106119
$this->assertSame($expectedResult, $this->checker->isReadOnly($path, $scope, $scopeCode));
107120
}
@@ -118,6 +131,7 @@ public function isReadonlyDataProvider()
118131
'scopeCode' => 'myWebsite',
119132
'confValue' => 'value',
120133
'variables' => [],
134+
'configMap' => [],
121135
'expectedResult' => true,
122136
],
123137
[
@@ -126,6 +140,7 @@ public function isReadonlyDataProvider()
126140
'scopeCode' => 'myWebsite',
127141
'confValue' => null,
128142
'variables' => ['SOME_PLACEHOLDER' => 'value'],
143+
'configMap' => [],
129144
'expectedResult' => true,
130145
],
131146
[
@@ -134,7 +149,58 @@ public function isReadonlyDataProvider()
134149
'scopeCode' => 'myWebsite',
135150
'confValue' => null,
136151
'variables' => [],
152+
'configMap' => [],
137153
'expectedResult' => false,
154+
],
155+
[
156+
'path' => 'general/web/locale',
157+
'scope' => 'website',
158+
'scopeCode' => 'myWebsite',
159+
'confValue' => null,
160+
'variables' => [],
161+
'configMap' => [
162+
[
163+
'system/default/general/web/locale',
164+
null,
165+
'default_value',
166+
],
167+
],
168+
'expectedResult' => true,
169+
],
170+
[
171+
'path' => 'general/web/locale',
172+
'scope' => 'website',
173+
'scopeCode' => 'myWebsite',
174+
'confValue' => null,
175+
'variables' => [],
176+
'configMap' => [
177+
[
178+
'system/default/general/web/locale',
179+
null,
180+
'default_value',
181+
],
182+
],
183+
'expectedResult' => true,
184+
],
185+
[
186+
'path' => 'general/web/locale',
187+
'scope' => 'store',
188+
'scopeCode' => 'myStore',
189+
'confValue' => null,
190+
'variables' => [],
191+
'configMap' => [
192+
[
193+
'system/default/general/web/locale',
194+
null,
195+
'default_value',
196+
],
197+
[
198+
'system/website/myWebsite/general/web/locale',
199+
null,
200+
null,
201+
],
202+
],
203+
'expectedResult' => true,
138204
]
139205
];
140206
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<preference for="Magento\ConfigurableProduct\Api\Data\OptionInterface" type="Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute" />
1313
<preference for="Magento\ConfigurableProduct\Api\Data\OptionValueInterface" type="Magento\ConfigurableProduct\Model\Product\Type\Configurable\OptionValue" />
1414
<preference for="Magento\ConfigurableProduct\Api\Data\ConfigurableItemOptionValueInterface" type="Magento\ConfigurableProduct\Model\Quote\Item\ConfigurableItemOptionValue" />
15+
<preference for="Magento\ConfigurableProduct\Pricing\Price\PriceResolverInterface" type="Magento\ConfigurableProduct\Pricing\Price\ConfigurablePriceResolver" />
1516
<preference for="Magento\ConfigurableProduct\Pricing\Price\ConfigurableOptionsProviderInterface" type="Magento\ConfigurableProduct\Pricing\Price\ConfigurableOptionsProvider" />
1617
<preference for="Magento\ConfigurableProduct\Pricing\Price\LowestPriceOptionsProviderInterface" type="Magento\ConfigurableProduct\Pricing\Price\LowestPriceOptionsProvider" />
1718
<preference for="Magento\ConfigurableProduct\Model\AttributeOptionProviderInterface" type="Magento\ConfigurableProduct\Model\AttributeOptionProvider" />

app/code/Magento/Customer/view/frontend/web/js/customer-data.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ define([
1111
'underscore',
1212
'ko',
1313
'Magento_Customer/js/section-config',
14+
'mage/url',
1415
'mage/storage',
1516
'jquery/jquery-storageapi'
16-
], function ($, _, ko, sectionConfig) {
17+
], function ($, _, ko, sectionConfig, url) {
1718
'use strict';
1819

19-
var options,
20+
var options = {},
2021
storage,
2122
storageInvalidation,
2223
invalidateCacheBySessionTimeOut,
@@ -25,6 +26,9 @@ define([
2526
buffer,
2627
customerData;
2728

29+
url.setBaseUrl(window.BASE_URL);
30+
options.sectionLoadUrl = url.build('customer/section/load');
31+
2832
//TODO: remove global change, in this case made for initNamespaceStorage
2933
$.cookieStorage.setConf({
3034
path: '/',

app/code/Magento/Email/Block/Adminhtml/Template/Edit/Form.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
*/
1010
namespace Magento\Email\Block\Adminhtml\Template\Edit;
1111

12+
/**
13+
* Adminhtml email template edit form block
14+
*/
1215
class Form extends \Magento\Backend\Block\Widget\Form\Generic
1316
{
1417
/**
@@ -54,7 +57,8 @@ public function __construct(
5457

5558
/**
5659
* Prepare layout.
57-
* Add files to use dialog windows
60+
*
61+
* Add files to use dialog windows.
5862
*
5963
* @return $this
6064
*/
@@ -191,7 +195,7 @@ public function getVariables()
191195
}
192196
$template = $this->getEmailTemplate();
193197
if ($template->getId() && ($templateVariables = $template->getVariablesOptionArray(true))) {
194-
$variables = array_merge_recursive($variables, $templateVariables);
198+
$variables = array_merge_recursive($variables, [$templateVariables]);
195199
}
196200
return $variables;
197201
}

app/code/Magento/Email/Model/Template.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ public function getVariablesOptionArray($withGroup = false)
326326
$optionArray[] = ['value' => '{{' . $value . '}}', 'label' => __('%1', $label)];
327327
}
328328
if ($withGroup) {
329-
$optionArray = [['label' => __('Template Variables'), 'value' => $optionArray]];
329+
$optionArray = ['label' => __('Template Variables'), 'value' => $optionArray];
330330
}
331331
}
332332
return $optionArray;

app/code/Magento/Email/Test/Unit/Block/Adminhtml/Template/Edit/FormTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function testGetVariables()
7575
->method('getVariablesOptionArray')
7676
->willReturn(['template var 1', 'template var 2']);
7777
$this->assertEquals(
78-
['var1', 'var2', 'var3', 'custom var 1', 'custom var 2', 'template var 1', 'template var 2'],
78+
['var1', 'var2', 'var3', 'custom var 1', 'custom var 2', ['template var 1', 'template var 2']],
7979
$this->form->getVariables()
8080
);
8181
}

0 commit comments

Comments
 (0)