Skip to content

Commit 0b33e2a

Browse files
committed
Merge branch '2.4-develop' into BUG#AC-901
2 parents 52e5233 + 1ef4504 commit 0b33e2a

File tree

95 files changed

+1601
-686
lines changed

Some content is hidden

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

95 files changed

+1601
-686
lines changed

app/code/Magento/Backend/App/DefaultPath.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22
/**
3-
* Default application path for backend area
4-
*
53
* Copyright © Magento, Inc. All rights reserved.
64
* See COPYING.txt for license details.
75
*/
86
namespace Magento\Backend\App;
97

108
/**
9+
* Default application path for backend area
10+
*
1111
* @api
1212
* @since 100.0.2
1313
*/
@@ -24,7 +24,11 @@ class DefaultPath implements \Magento\Framework\App\DefaultPathInterface
2424
*/
2525
public function __construct(\Magento\Backend\App\ConfigInterface $config)
2626
{
27-
$pathParts = explode('/', $config->getValue('web/default/admin'));
27+
$pathConfigValue = $config->getValue('web/default/admin') ?? '';
28+
$pathParts = [];
29+
if ($pathConfigValue) {
30+
$pathParts = explode('/', $pathConfigValue);
31+
}
2832

2933
$this->_parts = [
3034
'area' => isset($pathParts[0]) ? $pathParts[0] : '',

app/code/Magento/Backend/view/adminhtml/templates/widget/tabshoriz.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use Magento\Framework\View\Helper\SecureHtmlRenderer;
1919
<?php foreach ($tabs as $_tab): ?>
2020
<?php $tabId = $block->getTabId($_tab) ?>
2121
<?php $_tabClass = 'tab-item-link ' . $block->getTabClass($_tab) . ' ' .
22-
(preg_match('/\s?ajax\s?/', $_tab->getClass()) ? 'notloaded' : '') ?>
22+
($_tab->getClass() !== null ? (preg_match('/\s?ajax\s?/', $_tab->getClass()) ? 'notloaded' : '') : '') ?>
2323
<?php $_tabType = (!preg_match('/\s?ajax\s?/', $_tabClass) && $block->getTabUrl($_tab) != '#') ? 'link' : '' ?>
2424
<?php $_tabHref = $block->getTabUrl($_tab) == '#' ?
2525
'#' . $tabId . '_content' :

app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ protected function _getIndexableAttributes($multiSelect)
105105
);
106106

107107
if ($multiSelect == true) {
108-
$select->where('ea.backend_type = ?', 'varchar')->where('ea.frontend_input = ?', 'multiselect');
108+
$select->where('ea.backend_type = ?', 'text')->where('ea.frontend_input = ?', 'multiselect');
109109
} else {
110110
$select->where('ea.backend_type = ?', 'int')->where('ea.frontend_input IN( ? )', ['select', 'boolean']);
111111
}
@@ -303,14 +303,14 @@ protected function _prepareMultiselectIndex($entityIds = null, $attributeId = nu
303303
// prepare get multiselect values query
304304
$productValueExpression = $connection->getCheckSql('pvs.value_id > 0', 'pvs.value', 'pvd.value');
305305
$select = $connection->select()->from(
306-
['pvd' => $this->getTable('catalog_product_entity_varchar')],
306+
['pvd' => $this->getTable('catalog_product_entity_text')],
307307
[]
308308
)->join(
309309
['cs' => $this->getTable('store')],
310310
'',
311311
[]
312312
)->joinLeft(
313-
['pvs' => $this->getTable('catalog_product_entity_varchar')],
313+
['pvs' => $this->getTable('catalog_product_entity_text')],
314314
"pvs.{$productIdField} = pvd.{$productIdField} AND pvs.attribute_id = pvd.attribute_id"
315315
. ' AND pvs.store_id=cs.store_id',
316316
[]
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Catalog\Setup\Patch\Data;
8+
9+
use Magento\Catalog\Model\Product;
10+
use Magento\Eav\Setup\EavSetup;
11+
use Magento\Eav\Setup\EavSetupFactory;
12+
use Magento\Framework\Exception\LocalizedException;
13+
use Magento\Framework\Setup\ModuleDataSetupInterface;
14+
use Magento\Framework\Setup\Patch\DataPatchInterface;
15+
16+
class UpdateMultiselectAttributesBackendTypes implements DataPatchInterface
17+
{
18+
/**
19+
* @var ModuleDataSetupInterface
20+
*/
21+
private $dataSetup;
22+
/**
23+
* @var EavSetupFactory
24+
*/
25+
private $eavSetupFactory;
26+
27+
/**
28+
* MigrateMultiselectAttributesData constructor.
29+
* @param ModuleDataSetupInterface $dataSetup
30+
* @param EavSetupFactory $eavSetupFactory
31+
*/
32+
public function __construct(
33+
ModuleDataSetupInterface $dataSetup,
34+
EavSetupFactory $eavSetupFactory
35+
) {
36+
$this->dataSetup = $dataSetup;
37+
$this->eavSetupFactory = $eavSetupFactory;
38+
}
39+
40+
/**
41+
* @inheritdoc
42+
*/
43+
public static function getDependencies()
44+
{
45+
return [];
46+
}
47+
48+
/**
49+
* @inheritdoc
50+
*/
51+
public function getAliases()
52+
{
53+
return [];
54+
}
55+
56+
/**
57+
* @inheritdoc
58+
*/
59+
public function apply()
60+
{
61+
$this->dataSetup->startSetup();
62+
63+
$connection = $this->dataSetup->getConnection();
64+
$attributeTable = $connection->getTableName('eav_attribute');
65+
/** @var EavSetup $eavSetup */
66+
$eavSetup = $this->eavSetupFactory->create(['setup' => $this->dataSetup]);
67+
$entityTypeId = $eavSetup->getEntityTypeId(Product::ENTITY);
68+
$attributesToMigrate = $connection->fetchCol(
69+
$connection
70+
->select()
71+
->from($attributeTable, ['attribute_id'])
72+
->where('entity_type_id = ?', $entityTypeId)
73+
->where('backend_type = ?', 'varchar')
74+
->where('frontend_input = ?', 'multiselect')
75+
);
76+
77+
$varcharTable = $connection->getTableName('catalog_product_entity_varchar');
78+
$textTable = $connection->getTableName('catalog_product_entity_text');
79+
$varcharTableDataSql = $connection
80+
->select()
81+
->from($varcharTable)
82+
->where('attribute_id in (?)', $attributesToMigrate);
83+
$dataToMigrate = array_map(static function ($row) {
84+
$row['value_id'] = null;
85+
return $row;
86+
}, $connection->fetchAll($varcharTableDataSql));
87+
88+
foreach (array_chunk($dataToMigrate, 2000) as $dataChunk) {
89+
$connection->insertMultiple($textTable, $dataChunk);
90+
}
91+
92+
$connection->query($connection->deleteFromSelect($varcharTableDataSql, $varcharTable));
93+
94+
foreach ($attributesToMigrate as $attributeId) {
95+
$eavSetup->updateAttribute($entityTypeId, $attributeId, 'backend_type', 'text');
96+
}
97+
98+
$this->dataSetup->endSetup();
99+
100+
return $this;
101+
}
102+
}

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

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,26 @@
3333
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openAdminCategoryIndexPage"/>
3434
<!--Create subcategory under parent category -->
3535
<actionGroup ref="AdminExpandCategoryTreeActionGroup" stepKey="clickOnExpandTree"/>
36-
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$createCategory.name$$)}}" stepKey="selectCategory"/>
37-
<waitForPageLoad stepKey="waitForPageToLoad"/>
36+
<actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="selectCategory">
37+
<argument name="category" value="$$createCategory$$"/>
38+
</actionGroup>
39+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageToLoad"/>
3840
<click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategoryButton"/>
3941
<checkOption selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="enableCategory"/>
4042
<checkOption selector="{{AdminCategoryBasicFieldSection.IncludeInMenu}}" stepKey="enableIncludeInMenu"/>
4143
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{SimpleSubCategory.name}}" stepKey="addSubCategoryName"/>
4244
<actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSubCategory"/>
43-
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/>
45+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeSuccessMessage">
46+
<argument name="message" value="You saved the category."/>
47+
</actionGroup>
4448
<!-- Verify Parent Category and Sub category is not visible in navigation menu -->
4549
<amOnPage url="$$createCategory.custom_attributes[url_key]$$/{{SimpleSubCategory.urlKey}}.html" stepKey="openCategoryStoreFrontPage"/>
4650
<waitForPageLoad stepKey="waitForCategoryStoreFrontPageToLoad"/>
47-
<dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="dontSeeCategoryOnStoreNavigationBar"/>
48-
<dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="dontSeeSubCategoryOnStoreNavigation"/>
51+
<actionGroup ref="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup" stepKey="dontSeeCategoryOnStoreNavigationBar">
52+
<argument name="categoryName" value="$$createCategory.name$$"/>
53+
</actionGroup>
54+
<actionGroup ref="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup" stepKey="dontSeeSubCategoryOnStoreNavigation">
55+
<argument name="categoryName" value="{{SimpleSubCategory.name}}"/>
56+
</actionGroup>
4957
</test>
5058
</tests>

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

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,26 @@
3232
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openAdminCategoryIndexPage"/>
3333
<!--Create subcategory under parent category -->
3434
<actionGroup ref="AdminExpandCategoryTreeActionGroup" stepKey="clickOnExpandTree"/>
35-
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$createCategory.name$$)}}" stepKey="selectCategory"/>
36-
<waitForPageLoad stepKey="waitForPageToLoad"/>
35+
<actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="selectCategory">
36+
<argument name="category" value="$$createCategory$$"/>
37+
</actionGroup>
38+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageToLoad"/>
3739
<click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategoryButton"/>
3840
<checkOption selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="enableCategory"/>
3941
<checkOption selector="{{AdminCategoryBasicFieldSection.IncludeInMenu}}" stepKey="enableIncludeInMenu"/>
4042
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{SimpleSubCategory.name}}" stepKey="addSubCategoryName"/>
4143
<actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSubCategory"/>
42-
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/>
44+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeSuccessMessage">
45+
<argument name="message" value="You saved the category."/>
46+
</actionGroup>
4347
<!-- Verify Parent Category and Sub category is not visible in navigation menu -->
4448
<amOnPage url="$$createCategory.custom_attributes[url_key]$$/{{SimpleSubCategory.urlKey}}.html" stepKey="openCategoryStoreFrontPage"/>
4549
<waitForPageLoad stepKey="waitForCategoryStoreFrontPageToLoad"/>
46-
<dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="dontSeeCategoryOnStoreNavigationBar"/>
47-
<dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="dontSeeSubCategoryOnStoreNavigation"/>
50+
<actionGroup ref="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup" stepKey="dontSeeCategoryOnStoreNavigationBar">
51+
<argument name="categoryName" value="$$createCategory.name$$"/>
52+
</actionGroup>
53+
<actionGroup ref="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup" stepKey="dontSeeSubCategoryOnStoreNavigation">
54+
<argument name="categoryName" value="{{SimpleSubCategory.name}}"/>
55+
</actionGroup>
4856
</test>
4957
</tests>

app/code/Magento/CatalogWidget/Model/Rule/Condition/Product.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
class Product extends \Magento\Rule\Model\Condition\Product\AbstractProduct
2323
{
2424
/**
25-
* {@inheritdoc}
25+
* @var string
2626
*/
2727
protected $elementName = 'parameters';
2828

@@ -32,8 +32,6 @@ class Product extends \Magento\Rule\Model\Condition\Product\AbstractProduct
3232
protected $joinedAttributes = [];
3333

3434
/**
35-
* Store manager
36-
*
3735
* @var \Magento\Store\Model\StoreManagerInterface
3836
*/
3937
protected $storeManager;
@@ -182,7 +180,7 @@ protected function addGlobalAttribute(
182180
$linkField = $attribute->getEntity()->getLinkField();
183181

184182
$collection->getSelect()->join(
185-
[$alias => $collection->getTable('catalog_product_entity_varchar')],
183+
[$alias => $collection->getTable($attribute->getBackendTable())],
186184
"($alias.$linkField = e.$linkField) AND ($alias.store_id = $storeId)" .
187185
" AND ($alias.attribute_id = {$attribute->getId()})",
188186
[]

app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@
5353
</actionGroup>
5454

5555
<!--Go to Catalog > Categories (choose category where created products)-->
56-
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="onCategoryIndexPage"/>
57-
<waitForPageLoad stepKey="waitForCategoryPageLoadAddProducts" after="onCategoryIndexPage"/>
58-
<click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="clickExpandAll" after="waitForCategoryPageLoadAddProducts"/>
59-
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(SimpleSubCategory.name)}}" stepKey="clickCategoryLink"/>
60-
<waitForPageLoad stepKey="waitForCategoryPageLoad"/>
56+
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="onCategoryIndexPage"/>
57+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCategoryPageLoadAddProducts"/>
58+
<actionGroup ref="AdminExpandCategoryTreeActionGroup" stepKey="clickExpandAll"/>
59+
<actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="clickCategoryLink">
60+
<argument name="category" value="SimpleSubCategory"/>
61+
</actionGroup>
62+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCategoryPageLoad"/>
6163

6264
<!--Content > Add CMS Block: name saved block-->
6365
<waitForElementVisible selector="{{AdminCategoryContentSection.sectionHeader}}" stepKey="waitForContentSection"/>
@@ -75,8 +77,10 @@
7577
<actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="seeSuccessMessage"/>
7678

7779
<!--Go to Storefront > category-->
78-
<amOnPage url="$$simplecategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontCategoryPage"/>
79-
<waitForPageLoad stepKey="waitForStorefrontPageLoaded"/>
80+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="goToStorefrontCategoryPage">
81+
<argument name="category" value="$$simplecategory$$"/>
82+
</actionGroup>
83+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontPageLoaded"/>
8084

8185
<!--Check operators Greater than-->
8286
<dontSeeElement selector="{{InsertWidgetSection.checkElementStorefrontByPrice('10')}}" stepKey="dontSeeElementByPrice20"/>
@@ -95,8 +99,10 @@
9599
</actionGroup>
96100

97101
<!--Go to Storefront > category-->
98-
<amOnPage url="$$simplecategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontCategoryPage2"/>
99-
<waitForPageLoad stepKey="waitForStorefrontPageLoaded2"/>
102+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="goToStorefrontCategoryPage2">
103+
<argument name="category" value="$$simplecategory$$"/>
104+
</actionGroup>
105+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontPageLoaded2"/>
100106

101107
<!--Check operators Greater than-->
102108
<seeElement selector="{{InsertWidgetSection.checkElementStorefrontByPrice('10')}}" stepKey="seeElementByPrice20"/>
@@ -115,8 +121,10 @@
115121
</actionGroup>
116122

117123
<!--Go to Storefront > category-->
118-
<amOnPage url="$$simplecategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontCategoryPage3"/>
119-
<waitForPageLoad stepKey="waitForStorefrontPageLoaded3"/>
124+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="goToStorefrontCategoryPage3">
125+
<argument name="category" value="$$simplecategory$$"/>
126+
</actionGroup>
127+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontPageLoaded3"/>
120128

121129
<!--Check operators Greater than-->
122130
<dontSeeElement selector="{{InsertWidgetSection.checkElementStorefrontByPrice('10')}}" stepKey="dontSeeElementByPrice20s"/>
@@ -135,8 +143,10 @@
135143
</actionGroup>
136144

137145
<!--Go to Storefront > category-->
138-
<amOnPage url="$$simplecategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontCategoryPage4"/>
139-
<waitForPageLoad stepKey="waitForStorefrontPageLoaded4"/>
146+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="goToStorefrontCategoryPage4">
147+
<argument name="category" value="$$simplecategory$$"/>
148+
</actionGroup>
149+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontPageLoaded4"/>
140150

141151
<!--Check operators Greater than-->
142152
<seeElement selector="{{InsertWidgetSection.checkElementStorefrontByPrice('10')}}" stepKey="seeElementByPrice20s"/>

app/code/Magento/Checkout/Model/GuestPaymentInformationManagement.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ public function savePaymentInformation(
176176
}
177177
$this->limitShippingCarrier($quote);
178178

179+
if (!(int)$quote->getItemsQty()) {
180+
throw new CouldNotSaveException(__('Some of the products are disabled.'));
181+
}
182+
179183
$this->paymentMethodManagement->set($cartId, $paymentMethod);
180184
return true;
181185
}

0 commit comments

Comments
 (0)