Skip to content

Commit 4395ad8

Browse files
merge magento/2.3-develop into magento-epam/MC-18709
2 parents 2762a81 + 2cc9d29 commit 4395ad8

File tree

20 files changed

+331
-81
lines changed

20 files changed

+331
-81
lines changed

app/code/Magento/Analytics/Model/ExportDataHandler.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function __construct(
8989
public function prepareExportData()
9090
{
9191
try {
92-
$tmpDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::SYS_TMP);
92+
$tmpDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::VAR_DIR);
9393

9494
$this->prepareDirectory($tmpDirectory, $this->getTmpFilesDirRelativePath());
9595
$this->reportWriter->write($tmpDirectory, $this->getTmpFilesDirRelativePath());
@@ -157,7 +157,9 @@ private function prepareDirectory(WriteInterface $directory, $path)
157157
private function prepareFileDirectory(WriteInterface $directory, $path)
158158
{
159159
$directory->delete($path);
160+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
160161
if (dirname($path) !== '.') {
162+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
161163
$directory->create(dirname($path));
162164
}
163165

@@ -176,6 +178,7 @@ private function pack($source, $destination)
176178
$this->archive->pack(
177179
$source,
178180
$destination,
181+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
179182
is_dir($source) ?: false
180183
);
181184

app/code/Magento/Analytics/Test/Unit/Model/ExportDataHandlerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use Magento\Framework\Archive;
1414
use Magento\Framework\Filesystem;
1515
use Magento\Framework\Filesystem\Directory\WriteInterface;
16-
use Magento\Framework\Filesystem\DirectoryList;
16+
use Magento\Framework\App\Filesystem\DirectoryList;
1717
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
1818

1919
class ExportDataHandlerTest extends \PHPUnit\Framework\TestCase
@@ -137,7 +137,7 @@ public function testPrepareExportData($isArchiveSourceDirectory)
137137
$this->filesystemMock
138138
->expects($this->once())
139139
->method('getDirectoryWrite')
140-
->with(DirectoryList::SYS_TMP)
140+
->with(DirectoryList::VAR_DIR)
141141
->willReturn($this->directoryMock);
142142
$this->directoryMock
143143
->expects($this->exactly(4))
@@ -238,7 +238,7 @@ public function testPrepareExportDataWithLocalizedException()
238238
$this->filesystemMock
239239
->expects($this->once())
240240
->method('getDirectoryWrite')
241-
->with(DirectoryList::SYS_TMP)
241+
->with(DirectoryList::VAR_DIR)
242242
->willReturn($this->directoryMock);
243243
$this->reportWriterMock
244244
->expects($this->once())

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,8 @@
323323
</field>
324324
<field id="port" translate="label comment" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
325325
<label>Port (25)</label>
326-
<comment>For Windows server only.</comment>
326+
<validate>validate-digits validate-digits-range digits-range-0-65535</validate>
327+
<comment>Please enter at least 0 and at most 65535 (For Windows server only).</comment>
327328
</field>
328329
<field id="set_return_path" translate="label" type="select" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="1">
329330
<label>Set Return-Path</label>
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# BraintreeGraphQl
1+
# Magento_BraintreeGraphQl module
22

3-
**BraintreeGraphQl** provides type and resolver for method additional
4-
information.
3+
The Magento_BraintreeGraphQl module provides type and resolver information for the GraphQL module to pass payment information data from the client to Magento.
4+
5+
## Extensibility
6+
7+
Extension developers can interact with the Magento_BraintreeGraphQl module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html).
8+
9+
[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_BraintreeGraphQl module.

app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ public function modifyPrice(IndexTableStructure $priceTable, array $entityIds =
104104
$select->where('stock_item.use_config_manage_stock = 0 AND stock_item.manage_stock = 1');
105105
}
106106

107+
if (!empty($entityIds)) {
108+
$select->where('stock_item.product_id in (?)', $entityIds);
109+
}
110+
107111
$select->group('stock_item.product_id');
108112
$select->having('max_is_in_stock = 0');
109113

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\CatalogInventory\Test\Unit\Model\Indexer;
8+
9+
use Magento\CatalogInventory\Api\StockConfigurationInterface;
10+
use Magento\CatalogInventory\Model\Indexer\ProductPriceIndexFilter;
11+
use Magento\CatalogInventory\Model\ResourceModel\Stock\Item;
12+
use Magento\Framework\App\ResourceConnection;
13+
use Magento\Framework\DB\Query\Generator;
14+
use PHPUnit\Framework\MockObject\MockObject;
15+
use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\IndexTableStructure;
16+
17+
/**
18+
* Product Price filter test, to ensure that product id's filtered.
19+
*/
20+
class ProductPriceIndexFilterTest extends \PHPUnit\Framework\TestCase
21+
{
22+
23+
/**
24+
* @var MockObject|StockConfigurationInterface $stockConfiguration
25+
*/
26+
private $stockConfiguration;
27+
28+
/**
29+
* @var MockObject|Item $item
30+
*/
31+
private $item;
32+
33+
/**
34+
* @var MockObject|ResourceConnection $resourceCnnection
35+
*/
36+
private $resourceCnnection;
37+
38+
/**
39+
* @var MockObject|Generator $generator
40+
*/
41+
private $generator;
42+
43+
/**
44+
* @var ProductPriceIndexFilter $productPriceIndexFilter
45+
*/
46+
private $productPriceIndexFilter;
47+
48+
/**
49+
* @inheritDoc
50+
*/
51+
protected function setUp()
52+
{
53+
$this->stockConfiguration = $this->createMock(StockConfigurationInterface::class);
54+
$this->item = $this->createMock(Item::class);
55+
$this->resourceCnnection = $this->createMock(ResourceConnection::class);
56+
$this->generator = $this->createMock(Generator::class);
57+
58+
$this->productPriceIndexFilter = new ProductPriceIndexFilter(
59+
$this->stockConfiguration,
60+
$this->item,
61+
$this->resourceCnnection,
62+
'indexer',
63+
$this->generator,
64+
100
65+
);
66+
}
67+
68+
/**
69+
* Test to ensure that Modify Price method uses entityIds,
70+
*/
71+
public function testModifyPrice()
72+
{
73+
$entityIds = [1, 2, 3];
74+
$indexTableStructure = $this->createMock(IndexTableStructure::class);
75+
$connectionMock = $this->createMock(\Magento\Framework\DB\Adapter\AdapterInterface::class);
76+
$this->resourceCnnection->expects($this->once())->method('getConnection')->willReturn($connectionMock);
77+
$selectMock = $this->createMock(\Magento\Framework\DB\Select::class);
78+
$connectionMock->expects($this->once())->method('select')->willReturn($selectMock);
79+
$selectMock->expects($this->at(2))
80+
->method('where')
81+
->with('stock_item.product_id in (?)', $entityIds)
82+
->willReturn($selectMock);
83+
$this->generator->expects($this->once())
84+
->method('generate')
85+
->will(
86+
$this->returnCallback(
87+
$this->getBatchIteratorCallback($selectMock, 5)
88+
)
89+
);
90+
91+
$fetchStmtMock = $this->createPartialMock(\Zend_Db_Statement_Pdo::class, ['fetchAll']);
92+
$fetchStmtMock->expects($this->any())
93+
->method('fetchAll')
94+
->will($this->returnValue([['product_id' => 1]]));
95+
$connectionMock->expects($this->any())->method('query')->will($this->returnValue($fetchStmtMock));
96+
$this->productPriceIndexFilter->modifyPrice($indexTableStructure, $entityIds);
97+
}
98+
99+
/**
100+
* Returns batches.
101+
*
102+
* @param MockObject $selectMock
103+
* @param int $batchCount
104+
* @return \Closure
105+
*/
106+
private function getBatchIteratorCallback(MockObject $selectMock, int $batchCount): \Closure
107+
{
108+
$iteratorCallback = function () use ($batchCount, $selectMock): array {
109+
$result = [];
110+
$count = $batchCount;
111+
while ($count) {
112+
$count--;
113+
$result[$count] = $selectMock;
114+
}
115+
116+
return $result;
117+
};
118+
119+
return $iteratorCallback;
120+
}
121+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontRegionUpdatesAfterChangingCountryAndLeavingRegionSelectUnselectedTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Region updates after changing country "/>
15+
<title value="Region updates after changing country "/>
16+
<description value="Region dupdates after changing country and leaving region select unselected"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="https://github.com/magento/magento2/issues/23460"/>
19+
<group value="checkout"/>
20+
</annotations>
21+
<before>
22+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
23+
</before>
24+
<after>
25+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
26+
</after>
27+
28+
<!-- Login to storefront from customer -->
29+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginCustomer">
30+
<argument name="Customer" value="$$createCustomer$$"/>
31+
</actionGroup>
32+
33+
<actionGroup ref="StorefrontOpenMyAccountPageActionGroup" stepKey="goToMyAccountPage"/>
34+
35+
<actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="goToAddressBookPage">
36+
<argument name="menu" value="Address Book"/>
37+
</actionGroup>
38+
<actionGroup ref="StoreFrontClickEditDefaultShippingAddressActionGroup" stepKey="clickEditAddress"/>
39+
<selectOption selector="{{StorefrontCustomerAddressFormSection.country}}" userInput="{{updateCustomerFranceAddress.country}}" stepKey="selectCountry"/>
40+
<actionGroup ref="AdminSaveCustomerAddressActionGroup" stepKey="saveAddress"/>
41+
42+
<see selector="{{StorefrontCustomerAddressesSection.defaultShippingAddress}}" userInput="{{updateCustomerFranceAddress.country}}" stepKey="seeAssertCustomerDefaultShippingAddressCountry"/>
43+
</test>
44+
</tests>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ define([
162162
this._clearError();
163163
this._checkRegionRequired(country);
164164

165+
$(regionList).find('option:selected').removeAttr('selected');
166+
regionInput.val('');
167+
165168
// Populate state/province dropdown list if available or use input box
166169
if (this.options.regionJson[country]) {
167170
this._removeSelectOptions(regionList);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StoreFrontClickEditDefaultShippingAddressActionGroup">
12+
<annotations>
13+
<description>Click on the edit default shipping address link.</description>
14+
</annotations>
15+
16+
<click stepKey="ClickEditDefaultShippingAddress" selector="{{StorefrontCustomerAddressesSection.editDefaultShippingAddress}}"/>
17+
<waitForPageLoad stepKey="waitForStorefrontSignInPageLoad"/>
18+
</actionGroup>
19+
</actionGroups>

app/code/Magento/Eav/etc/db_schema.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,10 @@
458458
<constraint xsi:type="foreign" referenceId="EAV_ATTRIBUTE_OPTION_VALUE_STORE_ID_STORE_STORE_ID"
459459
table="eav_attribute_option_value" column="store_id" referenceTable="store"
460460
referenceColumn="store_id" onDelete="CASCADE"/>
461+
<constraint xsi:type="unique" referenceId="EAV_ATTRIBUTE_OPTION_VALUE_STORE_ID_OPTION_ID">
462+
<column name="store_id"/>
463+
<column name="option_id"/>
464+
</constraint>
461465
<index referenceId="EAV_ATTRIBUTE_OPTION_VALUE_OPTION_ID" indexType="btree">
462466
<column name="option_id"/>
463467
</index>
@@ -481,6 +485,10 @@
481485
referenceColumn="attribute_id" onDelete="CASCADE"/>
482486
<constraint xsi:type="foreign" referenceId="EAV_ATTRIBUTE_LABEL_STORE_ID_STORE_STORE_ID" table="eav_attribute_label"
483487
column="store_id" referenceTable="store" referenceColumn="store_id" onDelete="CASCADE"/>
488+
<constraint xsi:type="unique" referenceId="EAV_ATTRIBUTE_LABEL_ATTRIBUTE_ID_STORE_ID_UNIQUE">
489+
<column name="store_id"/>
490+
<column name="attribute_id"/>
491+
</constraint>
484492
<index referenceId="EAV_ATTRIBUTE_LABEL_STORE_ID" indexType="btree">
485493
<column name="store_id"/>
486494
</index>

app/code/Magento/Eav/etc/db_schema_whitelist.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@
287287
"constraint": {
288288
"PRIMARY": true,
289289
"EAV_ATTR_OPT_VAL_OPT_ID_EAV_ATTR_OPT_OPT_ID": true,
290-
"EAV_ATTRIBUTE_OPTION_VALUE_STORE_ID_STORE_STORE_ID": true
290+
"EAV_ATTRIBUTE_OPTION_VALUE_STORE_ID_STORE_STORE_ID": true,
291+
"EAV_ATTRIBUTE_OPTION_VALUE_STORE_ID_OPTION_ID": true
291292
}
292293
},
293294
"eav_attribute_label": {
@@ -304,7 +305,8 @@
304305
"constraint": {
305306
"PRIMARY": true,
306307
"EAV_ATTRIBUTE_LABEL_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID": true,
307-
"EAV_ATTRIBUTE_LABEL_STORE_ID_STORE_STORE_ID": true
308+
"EAV_ATTRIBUTE_LABEL_STORE_ID_STORE_STORE_ID": true,
309+
"EAV_ATTRIBUTE_LABEL_STORE_ID_ATTRIBUTE_ID": true
308310
}
309311
},
310312
"eav_form_type": {

app/code/Magento/Email/Test/Mftf/ActionGroup/EmailTemplateActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<amOnPage url="{{AdminEmailTemplateIndexPage.url}}" stepKey="navigateToEmailTemplatePage"/>
2222
<!--Click "Add New Template" button-->
2323
<click selector="{{AdminMainActionsSection.add}}" stepKey="clickAddNewTemplateButton"/>
24-
<!--Select value for "Template" drop-down menu in "Load default template" tab-->
24+
<!--Select value for "Template" drop-down menu in "Load Default Template" tab-->
2525
<selectOption selector="{{AdminEmailTemplateEditSection.templateDropDown}}" userInput="Registry Update" stepKey="selectValueFromTemplateDropDown"/>
2626
<!--Fill in required fields in "Template Information" tab and click "Save Template" button-->
2727
<click selector="{{AdminEmailTemplateEditSection.loadTemplateButton}}" stepKey="clickLoadTemplateButton"/>

app/code/Magento/Email/i18n/en_US.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ City,City
7272
"We're sorry, an error has occurred while generating this content.","We're sorry, an error has occurred while generating this content."
7373
"Invalid sender data","Invalid sender data"
7474
Title,Title
75-
"Load default template","Load default template"
75+
"Load Default Template","Load Default Template"
7676
Template,Template
7777
"Are you sure you want to strip tags?","Are you sure you want to strip tags?"
7878
"Are you sure you want to delete this template?","Are you sure you want to delete this template?"

app/code/Magento/Email/view/adminhtml/templates/template/edit.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use Magento\Framework\App\TemplateTypesInterface;
1212
<form action="<?= $block->escapeUrl($block->getLoadUrl()) ?>" method="post" id="email_template_load_form">
1313
<?= $block->getBlockHtml('formkey') ?>
1414
<fieldset class="admin__fieldset form-inline">
15-
<legend class="admin__legend"><span><?= $block->escapeHtml(__('Load default template')) ?></span></legend><br>
15+
<legend class="admin__legend"><span><?= $block->escapeHtml(__('Load Default Template')) ?></span></legend><br>
1616
<div class="admin__field">
1717
<label class="admin__field-label" for="template_select"><?= $block->escapeHtml(__('Template')) ?></label>
1818
<div class="admin__field-control">

lib/internal/Magento/Framework/Locale/Config.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ class Config implements \Magento\Framework\Locale\ConfigInterface
9191
'sk_SK', /*Slovak (Slovakia)*/
9292
'sl_SI', /*Slovenian (Slovenia)*/
9393
'sq_AL', /*Albanian (Albania)*/
94-
'sr_Cyrl_RS', /*Serbian (Serbia)*/
94+
'sr_Cyrl_RS', /*Serbian (Cyrillic, Serbia)*/
95+
'sr_Latn_RS', /*Serbian (Latin, Serbia)*/
9596
'sv_SE', /*Swedish (Sweden)*/
9697
'sv_FI', /*Swedish (Finland)*/
9798
'sw_KE', /*Swahili (Kenya)*/

lib/internal/Magento/Framework/Locale/Test/Unit/ConfigTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ConfigTest extends \PHPUnit\Framework\TestCase
1515
'es_MX', 'eu_ES', 'es_PE', 'et_EE', 'fa_IR', 'fi_FI', 'fil_PH', 'fr_CA', 'fr_FR', 'gu_IN',
1616
'he_IL', 'hi_IN', 'hr_HR', 'hu_HU', 'id_ID', 'is_IS', 'it_CH', 'it_IT', 'ja_JP', 'ka_GE',
1717
'km_KH', 'ko_KR', 'lo_LA', 'lt_LT', 'lv_LV', 'mk_MK', 'mn_Cyrl_MN', 'ms_Latn_MY', 'nl_NL', 'nb_NO',
18-
'nn_NO', 'pl_PL', 'pt_BR', 'pt_PT', 'ro_RO', 'ru_RU', 'sk_SK', 'sl_SI', 'sq_AL', 'sr_Cyrl_RS',
18+
'nn_NO', 'pl_PL', 'pt_BR', 'pt_PT', 'ro_RO', 'ru_RU', 'sk_SK', 'sl_SI', 'sq_AL', 'sr_Cyrl_RS', 'sr_Latn_RS',
1919
'sv_SE', 'sw_KE', 'th_TH', 'tr_TR', 'uk_UA', 'vi_VN', 'zh_Hans_CN', 'zh_Hant_HK', 'zh_Hant_TW', 'es_CL',
2020
'lo_LA', 'es_VE', 'en_IE',
2121
];

0 commit comments

Comments
 (0)