Skip to content

Commit 49012ea

Browse files
authored
Merge pull request #7871 from magento-l3/PR_05_SEP_2022_odubovyk
[L3] Bugfix delivery
2 parents 91549b9 + 403e378 commit 49012ea

File tree

32 files changed

+1199
-34
lines changed

32 files changed

+1199
-34
lines changed

app/code/Magento/Backend/view/adminhtml/web/js/media-uploader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ define([
5353
formData: {
5454
'form_key': window.FORM_KEY
5555
},
56-
dropZone: '[data-tab-panel=image-management]',
56+
dropZone: this.element.find('input[type=file]').closest('[role="dialog"]'),
5757
sequentialUploads: true,
5858
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
5959
maxFileSize: this.options.maxFileSize,

app/code/Magento/Catalog/Test/Fixture/Product.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77

88
namespace Magento\Catalog\Test\Fixture;
99

10+
use Magento\Catalog\Api\Data\ProductCustomOptionInterface;
1011
use Magento\Catalog\Api\Data\ProductInterface;
1112
use Magento\Catalog\Api\ProductRepositoryInterface;
1213
use Magento\Catalog\Model\Product\Attribute\Source\Status;
1314
use Magento\Catalog\Model\Product\Type;
1415
use Magento\Catalog\Model\Product\Visibility;
1516
use Magento\Framework\DataObject;
17+
use Magento\Framework\Exception\NoSuchEntityException;
1618
use Magento\TestFramework\Fixture\Api\DataMerger;
1719
use Magento\TestFramework\Fixture\Api\ServiceFactory;
1820
use Magento\TestFramework\Fixture\RevertibleDataFixtureInterface;
@@ -137,6 +139,7 @@ private function prepareData(array $data): array
137139
}
138140

139141
$data['product_links'] = $this->prepareLinksData($data);
142+
$data['options'] = $this->prepareOptions($data);
140143

141144
return $this->dataProcessor->process($this, $data);
142145
}
@@ -146,6 +149,7 @@ private function prepareData(array $data): array
146149
*
147150
* @param array $data
148151
* @return array
152+
* @throws NoSuchEntityException
149153
*/
150154
private function prepareLinksData(array $data): array
151155
{
@@ -181,4 +185,33 @@ private function prepareLinksData(array $data): array
181185

182186
return $links;
183187
}
188+
189+
/**
190+
*
191+
* Prepare custom option fixtures
192+
*
193+
* @param array $data
194+
* @return array
195+
*/
196+
private function prepareOptions(array $data): array
197+
{
198+
$options = [];
199+
$default = [
200+
'product_sku' => $data['sku'],
201+
'title' => 'customoption%uniqid%',
202+
'type' => ProductCustomOptionInterface::OPTION_TYPE_FIELD,
203+
'is_require' => true,
204+
'price' => 10.0,
205+
'price_type' => 'fixed',
206+
'sku' => 'customoption%uniqid%',
207+
'max_characters' => null,
208+
'values' => null,
209+
];
210+
$sortOrder = 1;
211+
foreach ($data['options'] as $item) {
212+
$options[] = $item + ['sort_order' => $sortOrder++] + $default;
213+
}
214+
215+
return $options;
216+
}
184217
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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="StorefrontCategorySidebarMobileMenuTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Storefront main menu in mobile view should allow expanding categories with children"/>
15+
<title value="Storefront main menu in mobile view should allow expanding categories with children"/>
16+
<description value="Storefront main menu in mobile view should allow expanding categories with children"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-6596"/>
19+
<useCaseId value="ACP2E-816"/>
20+
<group value="Catalog"/>
21+
</annotations>
22+
<before>
23+
<!-- Set the window size to trigger mobile layout -->
24+
<resizeWindow width="400" height="590" stepKey="resizeWindowToMobileView"/>
25+
<createData entity="ApiCategory" stepKey="createParentCategory"/>
26+
<createData entity="NewSubCategoryWithParent" stepKey="createSubCategory">
27+
<requiredEntity createDataKey="createParentCategory"/>
28+
</createData>
29+
</before>
30+
<after>
31+
<!-- Reset the window size to its original state -->
32+
<resizeWindow width="1280" height="1024" stepKey="resizeWindowToDesktop"/>
33+
<deleteData createDataKey="createSubCategory" stepKey="deleteSubCategory"/>
34+
<deleteData createDataKey="createParentCategory" stepKey="deleteParentCategory"/>
35+
</after>
36+
37+
<!-- Open the storefront home -->
38+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStorefrontPage"/>
39+
40+
<!-- Open the side menu and expand the root category -->
41+
<click selector="{{StorefrontHeaderSection.mobileMenuToggle}}" stepKey="openSideMenu"/>
42+
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createParentCategory.name$$)}}" stepKey="expandCategoryMenu"/>
43+
44+
<!-- Assert the category expanded successfully -->
45+
<actionGroup ref="StorefrontAssertCategoryNameIsShownInMenuActionGroup" stepKey="verifySubCatMenuItemIsVisibleInTheSidebar">
46+
<argument name="categoryName" value="$$createSubCategory.name$$"/>
47+
</actionGroup>
48+
49+
<!-- Open the subcategory and assert it opened successfully -->
50+
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createSubCategory.name$$)}}" stepKey="openSubCategory"/>
51+
<see userInput="$$createSubCategory.name$$" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryName"/>
52+
</test>
53+
</tests>

app/code/Magento/Catalog/view/frontend/templates/product/view/details.phtml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
*/
66

77
/** @var \Magento\Catalog\Block\Product\View\Details $block */
8+
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
89
?>
910
<?php if ($detailedInfoGroup = $block->getGroupSortedChildNames('detailed_info', 'getChildHtml')):?>
1011
<div class="product info detailed">
1112
<?php $layout = $block->getLayout(); ?>
1213
<div class="product data items" data-mage-init='{"tabs":{"openedState":"active"}}'>
14+
<?php $hideTabContent = false; ?>
1315
<?php foreach ($detailedInfoGroup as $name):?>
1416
<?php
1517
$html = $layout->renderElement($name);
@@ -19,7 +21,7 @@
1921
$alias = $layout->getElementAlias($name);
2022
$label = $block->getChildData($alias, 'title');
2123
?>
22-
<div class="data item title"
24+
<div class="data item title <?= !$hideTabContent ? 'active' : ''?>"
2325
data-role="collapsible" id="tab-label-<?= $block->escapeHtmlAttr($alias) ?>">
2426
<a class="data switch"
2527
tabindex="-1"
@@ -34,6 +36,13 @@
3436
id="<?= $block->escapeHtmlAttr($alias) ?>" data-role="content">
3537
<?= /* @noEscape */ $html ?>
3638
</div>
39+
<?= $hideTabContent
40+
? /* @noEscape */ $secureRenderer->renderStyleAsTag(
41+
'display: none;',
42+
'#' . $block->escapeHtmlAttr($alias)
43+
)
44+
: '' ?>
45+
<?php $hideTabContent = true; ?>
3746
<?php endforeach;?>
3847
</div>
3948
</div>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2949,7 +2949,7 @@ protected function checkUrlKeyDuplicates()
29492949
)->joinLeft(
29502950
['cpe' => $resource->getTable('catalog_product_entity')],
29512951
"cpe.entity_id = url_rewrite.entity_id"
2952-
)->where('request_path IN (?)', array_keys($urlKeys))
2952+
)->where('request_path IN (?)', array_map('strval', array_keys($urlKeys)))
29532953
->where('store_id IN (?)', $storeId)
29542954
->where('cpe.sku not in (?)', array_values($urlKeys))
29552955
);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ public function __construct(
5454
public function execute($ids)
5555
{
5656
$this->_productStockIndexerRows->execute($ids);
57-
$this->getCacheContext()->registerEntities(\Magento\Catalog\Model\Product::CACHE_TAG, $ids);
5857
}
5958

6059
/**
@@ -102,6 +101,7 @@ public function executeRow($id)
102101
*
103102
* @return \Magento\Framework\Indexer\CacheContext
104103
* @deprecated 100.0.7
104+
* @see we don't add dependecies this way anymore
105105
*/
106106
protected function getCacheContext()
107107
{

app/code/Magento/CatalogInventory/etc/mview.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,4 @@
1414
<table name="catalog_product_link" entity_column="product_id" />
1515
</subscriptions>
1616
</view>
17-
<view id="catalog_product_price" class="Magento\Catalog\Model\Indexer\Product\Price" group="indexer">
18-
<subscriptions>
19-
<table name="cataloginventory_stock_item" entity_column="product_id" />
20-
</subscriptions>
21-
</view>
2217
</config>

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
<table name="catalog_product_entity_varchar" entity_column="entity_id" />
1616
<table name="catalog_product_entity_datetime" entity_column="entity_id" />
1717
<table name="catalog_product_website" entity_column="product_id" />
18-
<table name="cataloginventory_stock_item" entity_column="product_id" />
1918
<table name="catalog_product_bundle_selection" entity_column="parent_product_id" />
2019
<table name="catalog_product_super_link" entity_column="product_id" />
2120
<table name="catalog_product_link" entity_column="product_id" />

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@ public function loadAttributeOptions()
8787
$productAttributes = array_filter(
8888
$productAttributes,
8989
function ($attribute) {
90-
return $attribute->getFrontendLabel() &&
91-
$attribute->getFrontendInput() !== 'text' &&
92-
$attribute->getAttributeCode() !== ProductInterface::STATUS;
90+
return $attribute->getFrontendLabel();
9391
}
9492
);
9593

0 commit comments

Comments
 (0)