Skip to content

Commit a4854f9

Browse files
authored
Merge branch '2.4-develop' into issue-30196
2 parents 843ce3a + 3835860 commit a4854f9

File tree

30 files changed

+586
-61
lines changed

30 files changed

+586
-61
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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="AwsS3StorefrontCaptchaOnCustomerLoginTest" extends="StorefrontCaptchaOnCustomerLoginTest">
12+
<annotations>
13+
<features value="Captcha"/>
14+
<stories value="Login with Customer Account + Captcha"/>
15+
<title value="AWS S3 Captcha customer login page test"/>
16+
<description value="Check CAPTCHA on Storefront Login Page."/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-39491" />
19+
<group value="remote_storage_aws_s3"/>
20+
</annotations>
21+
<before>
22+
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage"/>
23+
</before>
24+
<after>
25+
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage"/>
26+
</after>
27+
</test>
28+
</tests>

app/code/Magento/AwsS3/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "magento/module-aws-s-3",
2+
"name": "magento/module-aws-s3",
33
"description": "N/A",
44
"config": {
55
"sort-packages": true

app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@
5959
</actionGroup>
6060
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/>
6161
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/>
62+
<!-- Check that Bundle Options initialized with default quantity -->
63+
<grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" stepKey="grabbedFirstBundleOptionQuantity"/>
64+
<assertEquals stepKey="assertFirstBundleOptionDefaultQuantity">
65+
<expectedResult type="string">1</expectedResult>
66+
<actualResult type="string">$grabbedFirstBundleOptionQuantity</actualResult>
67+
</assertEquals>
68+
<grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" stepKey="grabbedSecondBundleOptionQuantity"/>
69+
<assertEquals stepKey="assertSecondBundleOptionDefaultQuantity">
70+
<expectedResult type="string">1</expectedResult>
71+
<actualResult type="string">$grabbedSecondBundleOptionQuantity</actualResult>
72+
</assertEquals>
73+
6274
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/>
6375
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/>
6476

@@ -108,6 +120,17 @@
108120
</actionGroup>
109121
<checkOption selector="{{AdminProductFormBundleSection.firstProductOption}}" stepKey="selectNewFirstGridRow2"/>
110122
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddNewSelectedBundleProducts"/>
123+
<!-- Check that existing Bundle Options do not loose user input quantity values -->
124+
<grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" stepKey="grabbedFirstBundleOptionQuantityAfterUserInput"/>
125+
<assertEquals stepKey="assertFirstBundleOptionDefaultQuantityAfterUserInput">
126+
<expectedResult type="string">{{BundleProduct.defaultQuantity}}</expectedResult>
127+
<actualResult type="string">$grabbedFirstBundleOptionQuantityAfterUserInput</actualResult>
128+
</assertEquals>
129+
<grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" stepKey="grabbedSecondBundleOptionQuantityAfterUserInput"/>
130+
<assertEquals stepKey="assertSecondBundleOptionDefaultQuantityAfterUserInput">
131+
<expectedResult type="string">{{BundleProduct.defaultQuantity}}</expectedResult>
132+
<actualResult type="string">$grabbedSecondBundleOptionQuantityAfterUserInput</actualResult>
133+
</assertEquals>
111134
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '2')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillNewProductDefaultQty1"/>
112135
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '3')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillNewProductDefaultQty2"/>
113136

app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-option-qty.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,26 @@ define([
1717
}
1818
},
1919

20+
/**
21+
* @inheritdoc
22+
*/
23+
setInitialValue: function () {
24+
this.initialValue = this.getInitialValue();
25+
26+
if (this.initialValue === undefined || this.initialValue === '') {
27+
this.initialValue = 1;
28+
}
29+
30+
if (this.value.peek() !== this.initialValue) {
31+
this.value(this.initialValue);
32+
}
33+
34+
this.on('value', this.onUpdate.bind(this));
35+
this.isUseDefault(this.disabled());
36+
37+
return this;
38+
},
39+
2040
/**
2141
* @inheritdoc
2242
*/
@@ -33,6 +53,5 @@ define([
3353

3454
return !this.visible() ? false : notEqual;
3555
}
36-
3756
});
3857
});

app/code/Magento/Captcha/Helper/Data.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ public function getFonts()
150150
*/
151151
public function getImgDir($website = null)
152152
{
153-
$mediaDir = $this->_filesystem->getDirectoryWrite(DirectoryList::MEDIA);
153+
// Captcha images are not re-used and should be stored only locally.
154+
$mediaDir = $this->_filesystem->getDirectoryWrite(DirectoryList::MEDIA, Filesystem\DriverPool::FILE);
154155
$captchaDir = '/captcha/' . $this->_getWebsiteCode($website);
155156
$mediaDir->create($captchaDir);
156157
return $mediaDir->getAbsolutePath($captchaDir) . '/';

app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ protected function prepareSelectsByRange(
430430
$field,
431431
$select,
432432
$range,
433-
\Magento\Framework\DB\Query\BatchIteratorInterface::NON_UNIQUE_FIELD_ITERATOR
433+
\Magento\Framework\DB\Query\BatchIteratorInterface::UNIQUE_FIELD_ITERATOR
434434
);
435435

436436
$queries = [];

app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,58 @@ protected function _productLimitationJoinPrice()
2525
$this->_productLimitationFilters->setUsePriceIndex(false);
2626
return $this->_productLimitationPrice(true);
2727
}
28+
29+
/**
30+
* Return approximately amount if too much entities.
31+
*
32+
* @return int|mixed
33+
*/
34+
public function getSize()
35+
{
36+
$sql = $this->getSelectCountSql();
37+
$possibleCount = $this->analyzeCount($sql);
38+
39+
if ($possibleCount > 20000) {
40+
return $possibleCount;
41+
}
42+
43+
return parent::getSize();
44+
}
45+
46+
/**
47+
* Analyze amount of entities in DB.
48+
*
49+
* @param $sql
50+
* @return int|mixed
51+
* @throws \Zend_Db_Statement_Exception
52+
*/
53+
private function analyzeCount($sql)
54+
{
55+
$results = $this->getConnection()->query('EXPLAIN ' . $sql)->fetchAll();
56+
$alias = $this->getMainTableAlias();
57+
58+
foreach ($results as $result) {
59+
if ($result['table'] == $alias) {
60+
return $result['rows'];
61+
}
62+
}
63+
64+
return 0;
65+
}
66+
67+
/**
68+
* Identify main table alias or its name if alias is not defined.
69+
*
70+
* @return string
71+
* @throws \LogicException
72+
*/
73+
private function getMainTableAlias()
74+
{
75+
foreach ($this->getSelect()->getPart(\Magento\Framework\DB\Select::FROM) as $tableAlias => $tableMetadata) {
76+
if ($tableMetadata['joinType'] == 'from') {
77+
return $tableAlias;
78+
}
79+
}
80+
throw new \LogicException("Main table cannot be identified.");
81+
}
2882
}

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1965,7 +1965,7 @@ private function getAlreadyExistedImage(array $imageRow, string $columnImage, st
19651965
if (filter_var($columnImage, FILTER_VALIDATE_URL)) {
19661966
$hash = $this->getFileHash($columnImage);
19671967
} else {
1968-
$path = $importDir . DS . $columnImage;
1968+
$path = $importDir . DIRECTORY_SEPARATOR . $columnImage;
19691969
$hash = $this->isFileExists($path) ? $this->getFileHash($path) : '';
19701970
}
19711971

@@ -1991,7 +1991,7 @@ function ($exists, $file) use ($hash) {
19911991
private function addImageHashes(array &$images): void
19921992
{
19931993
$productMediaPath = $this->filesystem->getDirectoryRead(DirectoryList::MEDIA)
1994-
->getAbsolutePath(DS . 'catalog' . DS . 'product');
1994+
->getAbsolutePath(DIRECTORY_SEPARATOR . 'catalog' . DIRECTORY_SEPARATOR . 'product');
19951995

19961996
foreach ($images as $storeId => $skus) {
19971997
foreach ($skus as $sku => $files) {
@@ -2188,7 +2188,7 @@ private function getImportDir(): string
21882188
$dirAddon = $dirConfig[DirectoryList::MEDIA][DirectoryList::PATH];
21892189

21902190
return empty($this->_parameters[Import::FIELD_NAME_IMG_FILE_DIR])
2191-
? $dirAddon . DS . $this->_mediaDirectory->getRelativePath('import')
2191+
? $dirAddon . DIRECTORY_SEPARATOR . $this->_mediaDirectory->getRelativePath('import')
21922192
: $this->_parameters[Import::FIELD_NAME_IMG_FILE_DIR];
21932193
}
21942194

app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Full.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,21 @@ public function execute($ids = null): void
149149

150150
$select = $connection->select();
151151
$select->distinct(true);
152-
$select->from(['e' => $entityMetadata->getEntityTable()], $entityMetadata->getIdentifierField());
152+
$select->from(
153+
[
154+
'e' => $entityMetadata->getEntityTable()
155+
],
156+
$entityMetadata->getIdentifierField()
157+
)->where(
158+
'type_id = ?',
159+
$indexer->getTypeId()
160+
);
153161

154162
$batchQueries = $this->batchQueryGenerator->generate(
155163
$entityMetadata->getIdentifierField(),
156164
$select,
157165
$batchRowCount,
158-
BatchIteratorInterface::NON_UNIQUE_FIELD_ITERATOR
166+
BatchIteratorInterface::UNIQUE_FIELD_ITERATOR
159167
);
160168

161169
foreach ($batchQueries as $query) {

app/code/Magento/Checkout/view/frontend/web/js/model/address-converter.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ define([
2727
// clone address form data to new object
2828
var addressData = $.extend(true, {}, formData),
2929
region,
30-
regionName = addressData.region;
30+
regionName = addressData.region,
31+
customAttributes;
3132

3233
if (mageUtils.isObject(addressData.street)) {
3334
addressData.street = this.objectToArray(addressData.street);
@@ -64,10 +65,20 @@ define([
6465
addressData['custom_attributes'] = _.map(
6566
addressData['custom_attributes'],
6667
function (value, key) {
67-
return {
68+
customAttributes = {
6869
'attribute_code': key,
6970
'value': value
7071
};
72+
73+
if (typeof value === 'boolean') {
74+
customAttributes = {
75+
'attribute_code': key,
76+
'value': value,
77+
'label': value === true ? 'Yes' : 'No'
78+
};
79+
}
80+
81+
return customAttributes;
7182
}
7283
);
7384
}

0 commit comments

Comments
 (0)