Skip to content

Commit 7e9566f

Browse files
authored
Merge branch '2.4-develop' into ACQE-5692
2 parents 19e5d0a + c333d32 commit 7e9566f

File tree

89 files changed

+2804
-400
lines changed

Some content is hidden

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

89 files changed

+2804
-400
lines changed

app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Magento\Catalog\Model\Entity\Attribute;
1414
use Magento\Eav\Block\Adminhtml\Attribute\PropertyLocker;
1515
use Magento\Framework\Data\FormFactory;
16+
use Magento\Framework\Exception\LocalizedException;
1617
use Magento\Framework\Registry;
1718

1819
/**
@@ -58,6 +59,7 @@ public function __construct(
5859
* @inheritDoc
5960
* @return $this
6061
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
62+
* @throws LocalizedException
6163
*/
6264
protected function _prepareForm()
6365
{
@@ -176,28 +178,34 @@ protected function _prepareForm()
176178
['form' => $form, 'attribute' => $attributeObject]
177179
);
178180

181+
$dependencies = $this->getLayout()->createBlock(
182+
\Magento\Backend\Block\Widget\Form\Element\Dependence::class
183+
)->addFieldMap(
184+
"is_html_allowed_on_front",
185+
'html_allowed_on_front'
186+
)->addFieldMap(
187+
"frontend_input",
188+
'frontend_input_type'
189+
)->addFieldMap(
190+
"is_searchable",
191+
'searchable'
192+
)->addFieldMap(
193+
"is_visible_in_advanced_search",
194+
'advanced_search'
195+
)->addFieldDependence(
196+
'advanced_search',
197+
'searchable',
198+
'1'
199+
);
200+
$this->_eventManager->dispatch(
201+
'adminhtml_catalog_product_attribute_edit_frontend_prepare_field_dependencies',
202+
['dependencies' => $dependencies]
203+
);
204+
179205
// define field dependencies
180206
$this->setChild(
181207
'form_after',
182-
$this->getLayout()->createBlock(
183-
\Magento\Backend\Block\Widget\Form\Element\Dependence::class
184-
)->addFieldMap(
185-
"is_html_allowed_on_front",
186-
'html_allowed_on_front'
187-
)->addFieldMap(
188-
"frontend_input",
189-
'frontend_input_type'
190-
)->addFieldMap(
191-
"is_searchable",
192-
'searchable'
193-
)->addFieldMap(
194-
"is_visible_in_advanced_search",
195-
'advanced_search'
196-
)->addFieldDependence(
197-
'advanced_search',
198-
'searchable',
199-
'1'
200-
)
208+
$dependencies
201209
);
202210

203211
$this->setForm($form);

app/code/Magento/Catalog/Model/ResourceModel/Category/Collection.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
* Category resource collection
1717
*
1818
* @api
19-
* @author Magento Core Team <core@magentocommerce.com>
2019
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2120
* @since 100.0.2
2221
*/
@@ -568,8 +567,7 @@ private function getProductsCountFromCategoryTable(Category $item, string $websi
568567
*/
569568
private function getProductsCountQuery(array $categoryIds, $addVisibilityFilter = true): Select
570569
{
571-
$connections = $this->_resource->getConnection();
572-
$categoryTable = $connections->getTableName('catalog_category_product_index');
570+
$categoryTable = $this->_resource->getTableName('catalog_category_product_index');
573571
$select = $this->_conn->select()
574572
->from(
575573
['cat_index' => $categoryTable],

app/code/Magento/Catalog/Test/Mftf/Test/SavingCustomAttributeValuesUsingUITest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
<actionGroup ref="AdminSetProductAttributeUseInLayeredNavigationOptionActionGroup" stepKey="setDropdownUseInLayeredNavigationNoResults">
5656
<argument name="useInLayeredNavigationValue" value="Filterable (with results)"/>
5757
</actionGroup>
58+
<selectOption selector="{{AdvancedAttributePropertiesSection.UseInSearch}}" userInput="Yes" stepKey="selectIsSearchAble"/>
5859
<selectOption selector="{{AttributePropertiesSection.useInSearchResultsLayeredNavigation}}" userInput="Yes" stepKey="selectUseInLayeredNavigationOption"/>
5960
<click stepKey="saveAttribute" selector="{{AttributePropertiesSection.Save}}"/>
6061

app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Product/Category/Action/Rows.php

Lines changed: 0 additions & 52 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="QuickSearchProductByAttributeNotSearchableUsedInLayeredNavigationTest">
11+
<annotations>
12+
<stories value="Search Product on Storefront"/>
13+
<title value="Products should not appear in search results when search by attribute value if attribute has the Use in search set to No"/>
14+
<description value="A product should not be searchable by attribute value if attribute has 'Use in search' to 'No' even if 'Use in Layered Navigation is set"/>
15+
<severity value="MAJOR"/>
16+
<testCaseId value="AC-9146"/>
17+
<group value="CatalogSearch"/>
18+
</annotations>
19+
<before>
20+
<!--Create category, attribute set with multiselect product attribute with two options-->
21+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
22+
<createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/>
23+
<createData entity="multipleSelectProductAttribute" stepKey="createMultiselectAttribute"/>
24+
<createData entity="ProductAttributeOption10" stepKey="firstMultiselectOption">
25+
<requiredEntity createDataKey="createMultiselectAttribute"/>
26+
</createData>
27+
<createData entity="ProductAttributeOption11" stepKey="secondMultiselectOption">
28+
<requiredEntity createDataKey="createMultiselectAttribute"/>
29+
</createData>
30+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getFirstMultiselectOption">
31+
<requiredEntity createDataKey="createMultiselectAttribute"/>
32+
</getData>
33+
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getSecondMultiselectOption">
34+
<requiredEntity createDataKey="createMultiselectAttribute"/>
35+
</getData>
36+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
37+
<amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$createAttributeSet.attribute_set_id$/" stepKey="onAttributeSetEdit"/>
38+
<waitForPageLoad stepKey="waitForAttributeSetPageLoad"/>
39+
<actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignMultiselectAttributeToGroup">
40+
<argument name="group" value="Product Details"/>
41+
<argument name="attribute" value="$createMultiselectAttribute.attribute_code$"/>
42+
</actionGroup>
43+
<actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/>
44+
45+
<!-- Create simple product with multiselect attribute -->
46+
<createData entity="SimpleOne" storeCode="all" stepKey="createFirstSimpleProduct">
47+
<field key="attribute_set_id">$createAttributeSet.attribute_set_id$</field>
48+
<requiredEntity createDataKey="createMultiselectAttribute"/>
49+
<requiredEntity createDataKey="getFirstMultiselectOption"/>
50+
<requiredEntity createDataKey="createCategory"/>
51+
</createData>
52+
</before>
53+
<after>
54+
<deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstSimpleProduct"/>
55+
<deleteData createDataKey="createMultiselectAttribute" stepKey="deleteMultiselectAttribute"/>
56+
<deleteData createDataKey="createAttributeSet" stepKey="deleteAttributeSet"/>
57+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
58+
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/>
59+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
60+
</after>
61+
62+
<!-- Set Use in layered navigation for attribute to Filterable -->
63+
<actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="goToDropdownAttributePage">
64+
<argument name="productAttributeCode" value="$createMultiselectAttribute.attribute_code$"/>
65+
</actionGroup>
66+
<actionGroup ref="AdminSetUseInSearchValueForProductAttributeActionGroup" stepKey="makeAttributeUnsearchableInAQuickSearch">
67+
<argument name="useInSearchValue" value="No"/>
68+
</actionGroup>
69+
<actionGroup ref="AdminSetProductAttributeUseInLayeredNavigationOptionActionGroup" stepKey="setDropdownUseInLayeredNavigationNoResults">
70+
<argument name="useInLayeredNavigationValue" value="Filterable (no results)"/>
71+
</actionGroup>
72+
<actionGroup ref="AdminProductAttributeSaveActionGroup" stepKey="saveMultiSelectAttribute"/>
73+
74+
<!-- Perform search with attribute value -->
75+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToFrontPage"/>
76+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront">
77+
<argument name="phrase" value="$getFirstMultiselectOption.label$"/>
78+
</actionGroup>
79+
80+
<!-- Should not see any search results -->
81+
<dontSee userInput="$$createFirstSimpleProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/>
82+
<see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/>
83+
</test>
84+
</tests>

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@
3838
<type name="Magento\Catalog\Model\Product\Action">
3939
<plugin name="catalogsearchFulltextMassAction" type="Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Product\Action"/>
4040
</type>
41-
<type name="Magento\Catalog\Model\Indexer\Product\Category\Action\Rows">
42-
<plugin name="catalogsearchFulltextCategoryAssignment" type="Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Product\Category\Action\Rows"/>
43-
</type>
4441
<type name="Magento\Store\Model\ResourceModel\Store">
4542
<plugin name="catalogsearchFulltextIndexerStoreView" type="Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Store\View" />
4643
</type>

app/code/Magento/CatalogSearch/etc/search_request.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@
2020
<queryReference clause="must" ref="visibility"/>
2121
</query>
2222
<query xsi:type="matchQuery" value="$search_term$" name="search">
23-
<match field="*"/>
23+
<match field="name" matchCondition="match_phrase_prefix"/>
2424
</query>
2525
<query xsi:type="matchQuery" value="$search_term$" name="partial_search">
26-
<match field="*"/>
2726
<match field="name" matchCondition="match_phrase_prefix"/>
2827
<match field="sku" matchCondition="match_phrase_prefix"/>
2928
</query>

app/code/Magento/Config/Console/Command/ConfigSetCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ public function __construct(
9292
$this->changeDetector = $changeDetector;
9393
$this->processorFacadeFactory = $processorFacadeFactory;
9494
$this->deploymentConfig = $deploymentConfig;
95-
$this->localeEmulator = $localeEmulator ??
96-
ObjectManager::getInstance()->get(LocaleEmulatorInterface::class);
95+
$this->localeEmulator = $localeEmulator;
9796

9897
parent::__construct();
9998
}

app/code/Magento/Config/Console/Command/ConfigShowCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ public function __construct(
126126
?: ObjectManager::getInstance()->get(PathValidatorFactory::class);
127127
$this->emulatedAreaProcessor = $emulatedAreaProcessor
128128
?: ObjectManager::getInstance()->get(EmulatedAdminhtmlAreaProcessor::class);
129-
$this->localeEmulator = $localeEmulator
130-
?: ObjectManager::getInstance()->get(LocaleEmulatorInterface::class);
129+
$this->localeEmulator = $localeEmulator;
131130
}
132131

133132
/**

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<preference for="Magento\Framework\App\Config\ConfigResource\ConfigInterface" type="Magento\Config\Model\ResourceModel\Config" />
1212
<preference for="Magento\Framework\App\Config\CommentParserInterface" type="Magento\Config\Model\Config\Parser\Comment" />
1313
<preference for="Magento\Config\Model\Config\Structure\ElementVisibilityInterface" type="Magento\Config\Model\Config\Structure\ElementVisibilityComposite" />
14-
<preference for="Magento\Config\Console\Command\LocaleEmulatorInterface" type="Magento\Config\Console\Command\LocaleEmulator\Proxy" />
14+
<preference for="Magento\Config\Console\Command\LocaleEmulatorInterface" type="Magento\Config\Console\Command\LocaleEmulator" />
1515
<type name="Magento\Config\Model\Config\Structure\ElementVisibilityComposite">
1616
<arguments>
1717
<argument name="visibility" xsi:type="array">
@@ -310,6 +310,12 @@
310310
<type name="Magento\Config\Console\Command\ConfigShowCommand">
311311
<arguments>
312312
<argument name="configSource" xsi:type="object">configShowSourceAggregated</argument>
313+
<argument name="localeEmulator" xsi:type="object">Magento\Config\Console\Command\LocaleEmulatorInterface\Proxy</argument>
314+
</arguments>
315+
</type>
316+
<type name="Magento\Config\Console\Command\ConfigSetCommand">
317+
<arguments>
318+
<argument name="localeEmulator" xsi:type="object">Magento\Config\Console\Command\LocaleEmulatorInterface\Proxy</argument>
313319
</arguments>
314320
</type>
315321
<type name="Magento\Framework\Console\CommandListInterface">

0 commit comments

Comments
 (0)