Skip to content

Commit 82bb2e4

Browse files
committed
Merge branch '2.4-develop' of https://github.com/magento-epam/magento2ce into MC-32789-Squashed
2 parents 3ae1ff3 + b3d318d commit 82bb2e4

File tree

19 files changed

+333
-179
lines changed

19 files changed

+333
-179
lines changed

app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,11 +572,11 @@ public function prepareProductIndex($indexData, $productData, $storeId)
572572
foreach ($indexData as $entityId => $attributeData) {
573573
foreach ($attributeData as $attributeId => $attributeValues) {
574574
$value = $this->getAttributeValue($attributeId, $attributeValues, $storeId);
575-
if (!empty($value)) {
575+
if ($value !== null && $value !== false && $value != '') {
576576
if (!isset($index[$attributeId])) {
577577
$index[$attributeId] = [];
578578
}
579-
$index[$attributeId][$entityId] = $value;
579+
$index[$attributeId][$entityId] = $value;
580580
}
581581
}
582582
}

app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/ProductDataMapper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ private function convertAttribute(Attribute $attribute, array $attributeValues,
209209
$productAttributes = [];
210210

211211
$retrievedValue = $this->retrieveFieldValue($attributeValues);
212-
if ($retrievedValue) {
212+
if ($retrievedValue !== null) {
213213
$productAttributes[$attribute->getAttributeCode()] = $retrievedValue;
214214

215215
if ($attribute->getIsSearchable()) {
@@ -354,7 +354,7 @@ private function getAttributeOptions(Attribute $attribute, int $storeId): array
354354
*/
355355
private function retrieveFieldValue(array $values)
356356
{
357-
$values = \array_filter(\array_unique($values));
357+
$values = \array_unique($values);
358358

359359
return count($values) === 1 ? \array_shift($values) : \array_values($values);
360360
}

app/code/Magento/Elasticsearch/SearchAdapter/Filter/Builder/Term.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function buildFilter(RequestFilterInterface $filter)
6868
$fieldName .= '.' . $suffix;
6969
}
7070

71-
if ($filter->getValue()) {
71+
if ($filter->getValue() !== false) {
7272
$operator = is_array($filter->getValue()) ? 'terms' : 'term';
7373
$filterQuery []= [
7474
$operator => [

app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckingWithCartPriceRuleMatchingSubtotalForMultiShipmentTest.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@
1919
<group value="Multishipment"/>
2020
<group value="SalesRule"/>
2121
</annotations>
22-
<before>
23-
<magentoCLI command="config:set multishipping/options/checkout_multiple 1" stepKey="allowShippingToMultipleAddresses"/>
24-
</before>
25-
<after>
26-
<magentoCLI command="config:set multishipping/options/checkout_multiple 0" stepKey="disableShippingToMultipleAddresses"/>
27-
</after>
2822
<actionGroup ref="AdminCreateCartPriceRuleActionsWithSubtotalActionGroup" before="goToProduct1" stepKey="createSubtotalCartPriceRuleActionsSection">
2923
<argument name="ruleName" value="CartPriceRuleConditionForSubtotalForMultiShipping"/>
3024
</actionGroup>

app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutWithMultipleAddressesTest.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
<before>
2323
<!-- Login as Admin -->
2424
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
25-
<!-- Set configurations -->
26-
<magentoCLI command="config:set multishipping/options/checkout_multiple 1" stepKey="allowShippingToMultipleAddresses"/>
2725
<!-- Create simple products -->
2826
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
2927
<createData entity="SimpleProduct" stepKey="firstProduct">

app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontOrderWithMultishippingTest.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
<createData entity="SimpleProduct2" stepKey="createProduct2"/>
2828
<createData entity="Simple_US_Customer_Two_Addresses" stepKey="createCustomer"/>
2929
<!-- Set configurations -->
30-
<magentoCLI command="config:set {{EnableMultiShippingCheckoutMultiple.path}} {{EnableMultiShippingCheckoutMultiple.value}}" stepKey="allowShippingToMultipleAddresses"/>
3130
<magentoCLI command="config:set {{EnableFreeShippingMethod.path}} {{EnableFreeShippingMethod.value}}" stepKey="enableFreeShipping"/>
3231
<magentoCLI command="config:set {{EnableFlatRateShippingMethod.path}} {{EnableFlatRateShippingMethod.value}}" stepKey="enableFlatRateShipping"/>
3332
<magentoCLI command="config:set {{EnableCheckMoneyOrderPaymentMethod.path}} {{EnableCheckMoneyOrderPaymentMethod.value}}" stepKey="enableCheckMoneyOrderPaymentMethod"/>
@@ -43,7 +42,6 @@
4342
<!-- Need logout before customer delete. Fatal error appears otherwise -->
4443
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
4544
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
46-
<magentoCLI command="config:set {{DisableMultiShippingCheckoutMultiple.path}} {{DisableMultiShippingCheckoutMultiple.value}}" stepKey="withdrawShippingToMultipleAddresses"/>
4745
<magentoCLI command="config:set {{DisableFreeShippingMethod.path}} {{DisableFreeShippingMethod.value}}" stepKey="disableFreeShipping"/>
4846
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearAllOrdersGridFilters"/>
4947
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>

app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
<before>
2323
<!-- Login as Admin -->
2424
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
25-
<!-- Set configurations -->
26-
<magentoCLI command="config:set multishipping/options/checkout_multiple 1" stepKey="allowShippingToMultipleAddresses"/>
2725
<!-- Create two simple products -->
2826
<createData entity="ApiCategory" stepKey="createCategory"/>
2927
<createData entity="_defaultProduct" stepKey="createFirstProduct">

app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest/AdminUrlRewritesForProductsWithConfigurationTurnedOffTest.xml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,26 @@
4141
<!--Flush cache-->
4242
<magentoCLI command="cache:flush" stepKey="cleanCache2"/>
4343
</after>
44+
4445
<!-- 1. Log in to Admin -->
4546
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
47+
4648
<!-- 2. Open Marketing - SEO & Search - URL Rewrites -->
47-
<amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="amOnUrlRewriteIndexPage"/>
48-
<click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters"/>
49-
<fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" userInput="$createSimpleProduct.custom_attributes[url_key]$.html" stepKey="inputProductName"/>
50-
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters"/>
51-
<waitForPageLoad stepKey="waitForPageToLoad"/>
52-
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeProducturl"/>
53-
<dontSeeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $simpleSubCategory1.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="dontSeeCategoryProducturlKey"/>
54-
<amOnPage url="/$simpleSubCategory1.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html" stepKey="navigateToProductPage"/>
55-
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createSimpleProduct.name$$" stepKey="seeProductName"/>
49+
<actionGroup ref="AdminSearchUrlRewriteByRequestPathActionGroup" stepKey="searchingUrlRewrite">
50+
<argument name="requestPath" value="$createSimpleProduct.custom_attributes[url_key]$.html"/>
51+
</actionGroup>
52+
<actionGroup ref="AssertAdminRequestPathInUrlRewriteGrigActionGroup" stepKey="seeProductUrlInGrid">
53+
<argument name="requestPath" value="$createSimpleProduct.custom_attributes[url_key]$.html"/>
54+
</actionGroup>
55+
<actionGroup ref="AssertAdminRequestPathIsNotFoundInUrlRewriteGrigActionGroup" stepKey="categoryProductUrlIsNotShown">
56+
<argument name="requestPath" value="$simpleSubCategory1.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html"/>
57+
</actionGroup>
58+
59+
<!-- 3. Assert the Redirect works and Product is present on StoreFront-->
60+
<actionGroup ref="AssertStorefrontProductRedirectActionGroup" stepKey="verifyProductInStoreFrontPage">
61+
<argument name="productName" value="$$createSimpleProduct.name$$"/>
62+
<argument name="productSku" value="$$createSimpleProduct.sku$$"/>
63+
<argument name="productRequestPath" value="/$simpleSubCategory1.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html"/>
64+
</actionGroup>
5665
</test>
5766
</tests>

dev/tests/integration/testsuite/Magento/Catalog/_files/product_boolean_attribute.php

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Magento\Eav\Api\AttributeRepositoryInterface;
1010
use Magento\Catalog\Model\ResourceModel\Eav\Attribute;
1111
use Magento\Eav\Model\Entity\Attribute\Source\Boolean;
12+
use Magento\Framework\Exception\NoSuchEntityException;
1213
use Magento\TestFramework\Helper\Bootstrap;
1314

1415
$objectManager = Bootstrap::getObjectManager();
@@ -19,32 +20,36 @@
1920
/** @var $installer CategorySetup */
2021
$installer = $objectManager->create(CategorySetup::class);
2122

22-
$attribute->setData(
23-
[
24-
'attribute_code' => 'boolean_attribute',
25-
'entity_type_id' => CategorySetup::CATALOG_PRODUCT_ENTITY_TYPE_ID,
26-
'is_global' => 0,
27-
'is_user_defined' => 1,
28-
'frontend_input' => 'boolean',
29-
'is_unique' => 0,
30-
'is_required' => 0,
31-
'is_searchable' => 1,
32-
'is_visible_in_advanced_search' => 1,
33-
'is_comparable' => 0,
34-
'is_filterable' => 1,
35-
'is_filterable_in_search' => 1,
36-
'is_used_for_promo_rules' => 0,
37-
'is_html_allowed_on_front' => 1,
38-
'is_visible_on_front' => 1,
39-
'used_in_product_listing' => 1,
40-
'used_for_sort_by' => 0,
41-
'frontend_label' => ['Boolean Attribute'],
42-
'backend_type' => 'int',
43-
'source_model' => Boolean::class
44-
]
45-
);
23+
try {
24+
$attributeRepository->get(CategorySetup::CATALOG_PRODUCT_ENTITY_TYPE_ID, 'boolean_attribute');
25+
} catch (NoSuchEntityException $e) {
26+
$attribute->setData(
27+
[
28+
'attribute_code' => 'boolean_attribute',
29+
'entity_type_id' => CategorySetup::CATALOG_PRODUCT_ENTITY_TYPE_ID,
30+
'is_global' => 0,
31+
'is_user_defined' => 1,
32+
'frontend_input' => 'boolean',
33+
'is_unique' => 0,
34+
'is_required' => 0,
35+
'is_searchable' => 1,
36+
'is_visible_in_advanced_search' => 1,
37+
'is_comparable' => 0,
38+
'is_filterable' => 1,
39+
'is_filterable_in_search' => 1,
40+
'is_used_for_promo_rules' => 0,
41+
'is_html_allowed_on_front' => 1,
42+
'is_visible_on_front' => 1,
43+
'used_in_product_listing' => 1,
44+
'used_for_sort_by' => 0,
45+
'frontend_label' => ['Boolean Attribute'],
46+
'backend_type' => 'int',
47+
'source_model' => Boolean::class
48+
]
49+
);
4650

47-
$attributeRepository->save($attribute);
51+
$attributeRepository->save($attribute);
4852

49-
/* Assign attribute to attribute set */
50-
$installer->addAttributeToGroup('catalog_product', 'Default', 'Attributes', $attribute->getId());
53+
/* Assign attribute to attribute set */
54+
$installer->addAttributeToGroup('catalog_product', 'Default', 'Attributes', $attribute->getId());
55+
}

dev/tests/integration/testsuite/Magento/Cms/_files/block.php

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,22 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
8+
use Magento\Cms\Api\BlockRepositoryInterface;
9+
use Magento\Cms\Model\Block;
10+
use Magento\Store\Model\StoreManagerInterface;
11+
use Magento\TestFramework\Helper\Bootstrap;
12+
13+
$objectManager = Bootstrap::getObjectManager();
14+
15+
/**
16+
* @var $block Block
17+
* @var $blockRepository BlockRepositoryInterface
18+
*/
19+
$block = $objectManager->create(Block::class);
20+
$blockRepository = $objectManager->create(BlockRepositoryInterface::class);
621

7-
/** @var $block \Magento\Cms\Model\Block */
8-
$block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Cms\Model\Block::class);
922
$block->setTitle(
1023
'CMS Block Title'
1124
)->setIdentifier(
@@ -20,8 +33,10 @@
2033
1
2134
)->setStores(
2235
[
23-
\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
24-
\Magento\Store\Model\StoreManagerInterface::class
36+
Bootstrap::getObjectManager()->get(
37+
StoreManagerInterface::class
2538
)->getStore()->getId()
2639
]
27-
)->save();
40+
);
41+
42+
$blockRepository->save($block);

0 commit comments

Comments
 (0)