Skip to content

Commit 1c464c2

Browse files
committed
Merge remote-tracking branch 'mainline/2.3-develop' into 2.3developPRnew
2 parents 53d861a + b8e3a0b commit 1c464c2

File tree

125 files changed

+2422
-779
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+2422
-779
lines changed

app/code/Magento/Backend/Test/Mftf/Section/AdminMainActionsSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminMainActionsSection">
1212
<element name="save" type="button" selector="#save" timeout="30"/>
13+
<element name="saveAndContinue" type="button" selector="button[id*=save_and_continue]" timeout="30"/>
1314
<element name="delete" type="button" selector="#delete" timeout="30"/>
1415
</section>
1516
</sections>

app/code/Magento/Backend/Test/Mftf/Section/AdminMessagesSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
<element name="success" type="text" selector="#messages div.message-success"/>
1313
<element name="nthSuccess" type="text" selector=".message.message-success.success:nth-of-type({{n}})>div" parameterized="true"/>
1414
<element name="error" type="text" selector="#messages div.message-error"/>
15+
<element name="notice" type="text" selector=".message.message-notice.notice"/>
1516
</section>
1617
</sections>

app/code/Magento/Backend/Test/Mftf/Section/AdminSlideOutDialogSection.xml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
6-
*/
7-
-->
8-
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
98
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
109
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1110
<section name="AdminSlideOutDialogSection">

app/code/Magento/Backend/etc/module.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<module name="Magento_Backend">
1010
<sequence>
1111
<module name="Magento_Directory"/>
12+
<module name="Magento_Theme"/>
1213
</sequence>
1314
</module>
1415
</config>

app/code/Magento/Backend/view/adminhtml/ui_component/design_config_listing.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77
-->
88
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
9+
<listingToolbar name="listing_top" />
910
<columns name="design_config_columns">
1011
<column name="theme_theme_id" component="Magento_Ui/js/grid/columns/select" sortOrder="40">
1112
<settings>

app/code/Magento/Bundle/Setup/Patch/Data/UpdateBundleRelatedEntityTytpes.php renamed to app/code/Magento/Bundle/Setup/Patch/Data/UpdateBundleRelatedEntityTypes.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66

77
namespace Magento\Bundle\Setup\Patch\Data;
88

9+
use Magento\Catalog\Api\Data\ProductAttributeInterface;
10+
use Magento\Eav\Setup\EavSetup;
911
use Magento\Eav\Setup\EavSetupFactory;
10-
use Magento\Framework\App\ResourceConnection;
1112
use Magento\Framework\Setup\ModuleDataSetupInterface;
1213
use Magento\Framework\Setup\Patch\DataPatchInterface;
1314
use Magento\Framework\Setup\Patch\PatchVersionInterface;
14-
use Magento\Catalog\Api\Data\ProductAttributeInterface;
15-
use Magento\Eav\Setup\EavSetup;
1615

1716
/**
18-
* Class UpdateBundleRelatedEntityTytpes
17+
* Class UpdateBundleRelatedEntityTypes
18+
*
1919
* @package Magento\Bundle\Setup\Patch
2020
*/
21-
class UpdateBundleRelatedEntityTytpes implements DataPatchInterface, PatchVersionInterface
21+
class UpdateBundleRelatedEntityTypes implements DataPatchInterface, PatchVersionInterface
2222
{
2323
/**
2424
* @var ModuleDataSetupInterface
@@ -31,7 +31,7 @@ class UpdateBundleRelatedEntityTytpes implements DataPatchInterface, PatchVersio
3131
private $eavSetupFactory;
3232

3333
/**
34-
* UpdateBundleRelatedEntityTytpes constructor.
34+
* UpdateBundleRelatedEntityTypes constructor.
3535
* @param ModuleDataSetupInterface $moduleDataSetup
3636
* @param EavSetupFactory $eavSetupFactory
3737
*/
@@ -44,7 +44,7 @@ public function __construct(
4444
}
4545

4646
/**
47-
* {@inheritdoc}
47+
* @inheritdoc
4848
*/
4949
public function apply()
5050
{
@@ -177,7 +177,7 @@ private function upgradeShipmentType(EavSetup $eavSetup)
177177
}
178178

179179
/**
180-
* {@inheritdoc}
180+
* @inheritdoc
181181
*/
182182
public static function getDependencies()
183183
{
@@ -187,15 +187,15 @@ public static function getDependencies()
187187
}
188188

189189
/**
190-
* {@inheritdoc}
190+
* @inheritdoc
191191
*/
192192
public static function getVersion()
193193
{
194194
return '2.0.2';
195195
}
196196

197197
/**
198-
* {@inheritdoc}
198+
* @inheritdoc
199199
*/
200200
public function getAliases()
201201
{

app/code/Magento/Catalog/Model/Indexer/Product/Flat/FlatTableBuilder.php

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
use Magento\Framework\EntityManager\MetadataPool;
1111

1212
/**
13-
* Class FlatTableBuilder
13+
* Class for building flat index
14+
*
1415
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1516
*/
1617
class FlatTableBuilder
@@ -346,12 +347,21 @@ protected function _updateTemporaryTableByStoreValues(
346347
}
347348

348349
//Update not simple attributes (eg. dropdown)
349-
if (isset($flatColumns[$attributeCode . $valueFieldSuffix])) {
350-
$select = $this->_connection->select()->joinInner(
351-
['t' => $this->_productIndexerHelper->getTable('eav_attribute_option_value')],
352-
't.option_id = et.' . $attributeCode . ' AND t.store_id=' . $storeId,
353-
[$attributeCode . $valueFieldSuffix => 't.value']
354-
);
350+
$columnName = $attributeCode . $valueFieldSuffix;
351+
if (isset($flatColumns[$columnName])) {
352+
$columnValue = $this->_connection->getIfNullSql('ts.value', 't0.value');
353+
$select = $this->_connection->select();
354+
$select->joinLeft(
355+
['t0' => $this->_productIndexerHelper->getTable('eav_attribute_option_value')],
356+
't0.option_id = et.' . $attributeCode . ' AND t0.store_id = 0',
357+
[]
358+
)->joinLeft(
359+
['ts' => $this->_productIndexerHelper->getTable('eav_attribute_option_value')],
360+
'ts.option_id = et.' . $attributeCode . ' AND ts.store_id = ' . $storeId,
361+
[]
362+
)->columns(
363+
[$columnName => $columnValue]
364+
)->where($columnValue . ' IS NOT NULL');
355365
if (!empty($changedIds)) {
356366
$select->where($this->_connection->quoteInto('et.entity_id IN (?)', $changedIds));
357367
}
@@ -374,6 +384,8 @@ protected function _getTemporaryTableName($tableName)
374384
}
375385

376386
/**
387+
* Get metadata pool
388+
*
377389
* @return \Magento\Framework\EntityManager\MetadataPool
378390
*/
379391
private function getMetadataPool()

app/code/Magento/Catalog/Model/Product/Option/Validator/DefaultValidator.php

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,20 @@ class DefaultValidator extends \Magento\Framework\Validator\AbstractValidator
2828
*/
2929
protected $priceTypes;
3030

31+
/**
32+
* @var \Magento\Framework\Locale\FormatInterface
33+
*/
34+
private $localeFormat;
35+
3136
/**
3237
* @param \Magento\Catalog\Model\ProductOptions\ConfigInterface $productOptionConfig
3338
* @param \Magento\Catalog\Model\Config\Source\Product\Options\Price $priceConfig
39+
* @param \Magento\Framework\Locale\FormatInterface|null $localeFormat
3440
*/
3541
public function __construct(
3642
\Magento\Catalog\Model\ProductOptions\ConfigInterface $productOptionConfig,
37-
\Magento\Catalog\Model\Config\Source\Product\Options\Price $priceConfig
43+
\Magento\Catalog\Model\Config\Source\Product\Options\Price $priceConfig,
44+
\Magento\Framework\Locale\FormatInterface $localeFormat = null
3845
) {
3946
foreach ($productOptionConfig->getAll() as $option) {
4047
foreach ($option['types'] as $type) {
@@ -45,6 +52,9 @@ public function __construct(
4552
foreach ($priceConfig->toOptionArray() as $item) {
4653
$this->priceTypes[] = $item['value'];
4754
}
55+
56+
$this->localeFormat = $localeFormat ?: \Magento\Framework\App\ObjectManager::getInstance()
57+
->get(\Magento\Framework\Locale\FormatInterface::class);
4858
}
4959

5060
/**
@@ -137,11 +147,11 @@ protected function validateOptionType(Option $option)
137147
*/
138148
protected function validateOptionValue(Option $option)
139149
{
140-
return $this->isInRange($option->getPriceType(), $this->priceTypes);
150+
return $this->isInRange($option->getPriceType(), $this->priceTypes) && $this->isNumber($option->getPrice());
141151
}
142152

143153
/**
144-
* Check whether value is empty
154+
* Check whether the value is empty
145155
*
146156
* @param mixed $value
147157
* @return bool
@@ -152,7 +162,7 @@ protected function isEmpty($value)
152162
}
153163

154164
/**
155-
* Check whether value is in range
165+
* Check whether the value is in range
156166
*
157167
* @param string $value
158168
* @param array $range
@@ -164,13 +174,24 @@ protected function isInRange($value, array $range)
164174
}
165175

166176
/**
167-
* Check whether value is not negative
177+
* Check whether the value is negative
168178
*
169179
* @param string $value
170180
* @return bool
171181
*/
172182
protected function isNegative($value)
173183
{
174-
return (int) $value < 0;
184+
return $this->localeFormat->getNumber($value) < 0;
185+
}
186+
187+
/**
188+
* Check whether the value is a number
189+
*
190+
* @param string $value
191+
* @return bool
192+
*/
193+
public function isNumber($value)
194+
{
195+
return is_numeric($this->localeFormat->getNumber($value));
175196
}
176197
}

app/code/Magento/Catalog/Model/Product/Option/Validator/Select.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
use Magento\Catalog\Model\Product\Option;
1010

11+
/**
12+
* Select validator class
13+
*/
1114
class Select extends DefaultValidator
1215
{
1316
/**
@@ -83,7 +86,7 @@ protected function isValidOptionPrice($priceType, $price, $storeId)
8386
if (!$priceType && !$price) {
8487
return true;
8588
}
86-
if (!$this->isInRange($priceType, $this->priceTypes)) {
89+
if (!$this->isInRange($priceType, $this->priceTypes) || !$this->isNumber($price)) {
8790
return false;
8891
}
8992

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="AdminAssignImageRolesActionGroup">
12+
<arguments>
13+
<argument name="image"/>
14+
</arguments>
15+
<conditionalClick selector="{{AdminProductImagesSection.productImagesToggleState('closed')}}" dependentSelector="{{AdminProductImagesSection.productImagesToggleState('open')}}" visible="false" stepKey="clickSectionImage"/>
16+
<click selector="{{AdminProductImagesSection.imageFile(image.fileName)}}" stepKey="clickProductImage"/>
17+
<waitForElementVisible selector="{{AdminProductImagesSection.altText}}" stepKey="seeAltTextSection"/>
18+
<checkOption selector="{{AdminProductImagesSection.roleBase}}" stepKey="checkRoleBase"/>
19+
<checkOption selector="{{AdminProductImagesSection.roleSmall}}" stepKey="checkRoleSmall"/>
20+
<checkOption selector="{{AdminProductImagesSection.roleThumbnail}}" stepKey="checkRoleThumbnail"/>
21+
<checkOption selector="{{AdminProductImagesSection.roleSwatch}}" stepKey="checkRoleSwatch"/>
22+
<click selector="{{AdminSlideOutDialogSection.closeButton}}" stepKey="clickCloseButton"/>
23+
</actionGroup>
24+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070

7171
<!--Save product and see success message-->
7272
<actionGroup name="saveProductForm">
73+
<scrollToTopOfPage stepKey="scrollTopPageProduct"/>
7374
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/>
7475
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/>
7576
</actionGroup>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@
243243
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/>
244244
<click selector="{{AdminProductGridSection.bulkActionOption('Change status')}}" stepKey="clickChangeStatusAction"/>
245245
<click selector="{{AdminProductGridSection.changeStatus('status')}}" stepKey="clickChangeStatusDisabled" parameterized="true"/>
246+
<waitForPageLoad stepKey="waitForStatusToBeChanged"/>
246247
<see selector="{{AdminMessagesSection.success}}" userInput="A total of 1 record(s) have been updated." stepKey="seeSuccessMessage"/>
247248
<waitForLoadingMaskToDisappear stepKey="waitForMaskToDisappear"/>
248249
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial2"/>

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,4 +497,13 @@
497497
<data key="name" unique="suffix">Product With Long Name And Sku - But not too long</data>
498498
<data key="sku" unique="suffix">Product With Long Name And Sku - But not too long</data>
499499
</entity>
500+
<entity name="Magento3" type="image">
501+
<data key="title" unique="suffix">Magento3</data>
502+
<data key="price">1.00</data>
503+
<data key="file_type">Upload File</data>
504+
<data key="shareable">Yes</data>
505+
<data key="file">magento3.jpg</data>
506+
<data key="filename">magento3</data>
507+
<data key="file_extension">jpg</data>
508+
</entity>
500509
</entities>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductImagesSection.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<element name="removeImageButton" type="button" selector=".action-remove"/>
1717
<element name="modalOkBtn" type="button" selector="button.action-primary.action-accept"/>
1818
<element name="uploadProgressBar" type="text" selector=".uploader .file-row"/>
19+
<element name="productImagesToggleState" type="button" selector="[data-index='gallery'] > [data-state-collapsible='{{status}}']" parameterized="true"/>
1920

2021
<element name="nthProductImage" type="button" selector="#media_gallery_content > div:nth-child({{var}}) img.product-image" parameterized="true"/>
2122
<element name="nthRemoveImageBtn" type="button" selector="#media_gallery_content > div:nth-child({{var}}) button.action-remove" parameterized="true"/>
@@ -32,4 +33,4 @@
3233
<element name="isThumbnailSelected" type="button" selector="//div[contains(@class, 'field-image-role')]//ul/li[contains(@class, 'selected')]/label[normalize-space(.) = 'Thumbnail']"/>
3334
<element name="isSwatchSelected" type="button" selector="//div[contains(@class, 'field-image-role')]//ul/li[contains(@class, 'selected')]/label[normalize-space(.) = 'Swatch']"/>
3435
</section>
35-
</sections>
36+
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMediaSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontProductMediaSection">
1212
<element name="imageFile" type="text" selector="//*[@class='product media']//img[contains(@src, '{{filename}}')]" parameterized="true"/>
13+
<element name="productImageActive" type="text" selector=".product.media div[data-active=true] > img[src*='{{filename}}']" parameterized="true"/>
1314
</section>
1415
</sections>

0 commit comments

Comments
 (0)