Skip to content

Commit 41fac4e

Browse files
author
Magento CICD
authored
merge magento/2.3-develop into magento-qwerty/MAGETWO-88431
2 parents 72509ce + 622f913 commit 41fac4e

File tree

86 files changed

+1830
-632
lines changed

Some content is hidden

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

86 files changed

+1830
-632
lines changed

app/code/Magento/AdminNotification/view/adminhtml/templates/system/messages/popup.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
{
2424
"[data-role=system_messages_list]": {
2525
"Magento_AdminNotification/js/system/messages/popup": {
26-
class: 'modal-system-messages ui-popup-message'
26+
"class":"modal-system-messages ui-popup-message"
2727
}
2828
}
2929
}
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
/**
22
* Copyright © Magento, Inc. All rights reserved.
33
* See COPYING.txt for license details.
4-
*/
4+
*/
55

66
define([
77
'jquery',
88
'Magento_Ui/js/modal/modal'
9-
], function ($) {
9+
], function ($, modal) {
1010
'use strict';
1111

1212
return function (data, element) {
13-
if (this.modal) {
14-
this.modal.html($(element).html());
13+
14+
if (modal.modal) {
15+
modal.modal.html($(element).html());
1516
} else {
16-
this.modal = $(element).modal({
17+
modal.modal = $(element).modal({
1718
modalClass: data.class,
1819
type: 'popup',
1920
buttons: []
2021
});
2122
}
22-
this.modal.modal('openModal');
23+
24+
modal.modal.modal('openModal');
2325
};
2426
});

app/code/Magento/Catalog/Helper/Data.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper
3232

3333
const CONFIG_USE_STATIC_URLS = 'cms/wysiwyg/use_static_urls_in_catalog';
3434

35+
/**
36+
* @deprecated
37+
* @see \Magento\Catalog\Helper\Output::isDirectivesExists
38+
*/
3539
const CONFIG_PARSE_URL_DIRECTIVES = 'catalog/frontend/parse_url_directives';
3640

3741
const XML_PATH_DISPLAY_PRODUCT_COUNT = 'catalog/layered_navigation/display_product_count';
@@ -443,6 +447,8 @@ public function isUsingStaticUrlsAllowed()
443447
* Check if the parsing of URL directives is allowed for the catalog
444448
*
445449
* @return bool
450+
* @deprecated
451+
* @see \Magento\Catalog\Helper\Output::isDirectivesExists
446452
*/
447453
public function isUrlDirectivesParsingAllowed()
448454
{
@@ -457,6 +463,7 @@ public function isUrlDirectivesParsingAllowed()
457463
* Retrieve template processor for catalog content
458464
*
459465
* @return \Magento\Framework\Filter\Template
466+
* @throws \Magento\Framework\Exception\LocalizedException
460467
*/
461468
public function getPageTemplateProcessor()
462469
{

app/code/Magento/Catalog/Helper/Output.php

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Catalog\Helper;
79

810
use Magento\Catalog\Model\Category as ModelCategory;
@@ -45,20 +47,29 @@ class Output extends \Magento\Framework\App\Helper\AbstractHelper
4547
protected $_escaper;
4648

4749
/**
50+
* @var array
51+
*/
52+
private $directivePatterns;
53+
54+
/**
55+
* Output constructor.
4856
* @param \Magento\Framework\App\Helper\Context $context
4957
* @param \Magento\Eav\Model\Config $eavConfig
5058
* @param Data $catalogData
5159
* @param \Magento\Framework\Escaper $escaper
60+
* @param array $directivePatterns
5261
*/
5362
public function __construct(
5463
\Magento\Framework\App\Helper\Context $context,
5564
\Magento\Eav\Model\Config $eavConfig,
5665
Data $catalogData,
57-
\Magento\Framework\Escaper $escaper
66+
\Magento\Framework\Escaper $escaper,
67+
$directivePatterns = []
5868
) {
5969
$this->_eavConfig = $eavConfig;
6070
$this->_catalogData = $catalogData;
6171
$this->_escaper = $escaper;
72+
$this->directivePatterns = $directivePatterns;
6273
parent::__construct($context);
6374
}
6475

@@ -134,6 +145,7 @@ public function process($method, $result, $params)
134145
* @param string $attributeName
135146
* @return string
136147
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
148+
* @throws \Magento\Framework\Exception\LocalizedException
137149
*/
138150
public function productAttribute($product, $attributeHtml, $attributeName)
139151
{
@@ -151,10 +163,12 @@ public function productAttribute($product, $attributeHtml, $attributeName)
151163
$attributeHtml = nl2br($attributeHtml);
152164
}
153165
}
154-
if ($attribute->getIsHtmlAllowedOnFront() && $attribute->getIsWysiwygEnabled()) {
155-
if ($this->_catalogData->isUrlDirectivesParsingAllowed()) {
156-
$attributeHtml = $this->_getTemplateProcessor()->filter($attributeHtml);
157-
}
166+
if ($attributeHtml !== null
167+
&& $attribute->getIsHtmlAllowedOnFront()
168+
&& $attribute->getIsWysiwygEnabled()
169+
&& $this->isDirectivesExists($attributeHtml)
170+
) {
171+
$attributeHtml = $this->_getTemplateProcessor()->filter($attributeHtml);
158172
}
159173

160174
$attributeHtml = $this->process(
@@ -173,6 +187,7 @@ public function productAttribute($product, $attributeHtml, $attributeName)
173187
* @param string $attributeHtml
174188
* @param string $attributeName
175189
* @return string
190+
* @throws \Magento\Framework\Exception\LocalizedException
176191
*/
177192
public function categoryAttribute($category, $attributeHtml, $attributeName)
178193
{
@@ -185,10 +200,13 @@ public function categoryAttribute($category, $attributeHtml, $attributeName)
185200
) {
186201
$attributeHtml = $this->_escaper->escapeHtml($attributeHtml);
187202
}
188-
if ($attribute->getIsHtmlAllowedOnFront() && $attribute->getIsWysiwygEnabled()) {
189-
if ($this->_catalogData->isUrlDirectivesParsingAllowed()) {
190-
$attributeHtml = $this->_getTemplateProcessor()->filter($attributeHtml);
191-
}
203+
if ($attributeHtml !== null
204+
&& $attribute->getIsHtmlAllowedOnFront()
205+
&& $attribute->getIsWysiwygEnabled()
206+
&& $this->isDirectivesExists($attributeHtml)
207+
208+
) {
209+
$attributeHtml = $this->_getTemplateProcessor()->filter($attributeHtml);
192210
}
193211
$attributeHtml = $this->process(
194212
'categoryAttribute',
@@ -197,4 +215,22 @@ public function categoryAttribute($category, $attributeHtml, $attributeName)
197215
);
198216
return $attributeHtml;
199217
}
218+
219+
/**
220+
* Check if string has directives
221+
*
222+
* @param string $attributeHtml
223+
* @return bool
224+
*/
225+
public function isDirectivesExists($attributeHtml)
226+
{
227+
$matches = false;
228+
foreach ($this->directivePatterns as $pattern) {
229+
if (preg_match($pattern, $attributeHtml)) {
230+
$matches = true;
231+
break;
232+
}
233+
}
234+
return $matches;
235+
}
200236
}

app/code/Magento/Catalog/Model/Api/SearchCriteria/CollectionProcessor/FilterProcessor/ProductCategoryFilter.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@ class ProductCategoryFilter implements CustomFilterInterface
2121
*/
2222
public function apply(Filter $filter, AbstractDb $collection)
2323
{
24-
$conditionType = $filter->getConditionType() ?: 'eq';
25-
$categoryFilter = [$conditionType => [$filter->getValue()]];
24+
$value = $filter->getValue();
25+
$conditionType = $filter->getConditionType() ?: 'in';
26+
$filterValue = [$value];
27+
if (($conditionType === 'in' || $conditionType === 'nin') && is_string($value)) {
28+
$filterValue = explode(',', $value);
29+
}
30+
$categoryFilter = [$conditionType => $filterValue];
2631

2732
/** @var Collection $collection */
2833
$collection->addCategoriesFilter($categoryFilter);

app/code/Magento/Catalog/Setup/Patch/Data/DisallowUsingHtmlForProductName.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
6+
declare(strict_types=1);
77
namespace Magento\Catalog\Setup\Patch\Data;
88

99
use Magento\Catalog\Setup\CategorySetupFactory;
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
namespace Magento\Catalog\Setup\Patch\Data;
8+
9+
use Magento\Framework\Setup\ModuleDataSetupInterface;
10+
use Magento\Framework\Setup\Patch\DataPatchInterface;
11+
12+
/**
13+
* Class EnableDirectiveParsing
14+
* @package Magento\Catalog\Setup\Patch
15+
*/
16+
class EnableDirectiveParsing implements DataPatchInterface
17+
{
18+
/**
19+
* @var ModuleDataSetupInterface
20+
*/
21+
private $moduleDataSetup;
22+
23+
/**
24+
* PatchInitial constructor.
25+
* @param ModuleDataSetupInterface $moduleDataSetup
26+
*/
27+
public function __construct(
28+
ModuleDataSetupInterface $moduleDataSetup
29+
) {
30+
$this->moduleDataSetup = $moduleDataSetup;
31+
}
32+
33+
/**
34+
* {@inheritdoc}
35+
*/
36+
public function apply()
37+
{
38+
$configTable = $this->moduleDataSetup->getTable('core_config_data');
39+
$select = $this->moduleDataSetup->getConnection()->select()
40+
->from($configTable)
41+
->where('path = ?', 'catalog/frontend/parse_url_directives');
42+
$config = $this->moduleDataSetup->getConnection()->fetchAll($select);
43+
if (!empty($config)) {
44+
$this->moduleDataSetup->getConnection()->update(
45+
$configTable,
46+
['value' => '1'],
47+
['path = ?' => 'catalog/frontend/parse_url_directives', 'value IN (?)' => '0']
48+
);
49+
}
50+
}
51+
52+
/**
53+
* {@inheritdoc}
54+
*/
55+
public static function getDependencies()
56+
{
57+
return [];
58+
}
59+
60+
/**
61+
* {@inheritdoc}
62+
*/
63+
public function getAliases()
64+
{
65+
return [];
66+
}
67+
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,10 @@
280280
<requiredEntity type="product_option">ProductOptionDateTime</requiredEntity>
281281
<requiredEntity type="product_option">ProductOptionTime</requiredEntity>
282282
</entity>
283+
<entity name="productWithOptions2" type="product">
284+
<var key="sku" entityType="product" entityKey="sku" />
285+
<requiredEntity type="product_option">ProductOptionDropDownWithLongValuesTitle</requiredEntity>
286+
</entity>
283287
<entity name="ApiVirtualProductWithDescription" type="product">
284288
<data key="sku" unique="suffix">api-virtual-product</data>
285289
<data key="type_id">virtual</data>

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@
5959
<requiredEntity type="product_option_value">ProductOptionValueDropdown1</requiredEntity>
6060
<requiredEntity type="product_option_value">ProductOptionValueDropdown2</requiredEntity>
6161
</entity>
62+
<entity name="ProductOptionDropDownWithLongValuesTitle" type="product_option">
63+
<var key="product_sku" entityType="product" entityKey="sku" />
64+
<data key="title">OptionDropDownWithLongTitles</data>
65+
<data key="type">drop_down</data>
66+
<data key="sort_order">4</data>
67+
<data key="is_require">true</data>
68+
<requiredEntity type="product_option_value">ProductOptionValueDropdownLongTitle1</requiredEntity>
69+
<requiredEntity type="product_option_value">ProductOptionValueDropdownLongTitle2</requiredEntity>
70+
</entity>
6271
<entity name="ProductOptionRadiobutton" type="product_option">
6372
<var key="product_sku" entityType="product" entityKey="sku" />
6473
<data key="title">OptionRadioButtons</data>
@@ -112,4 +121,4 @@
112121
<data key="price">0.00</data>
113122
<data key="price_type">percent</data>
114123
</entity>
115-
</entities>
124+
</entities>

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,16 @@
5050
<data key="price">2</data>
5151
<data key="price_type">fixed</data>
5252
</entity>
53-
</entities>
53+
<entity name="ProductOptionValueDropdownLongTitle1" type="product_option_value">
54+
<data key="title">Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj11111Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj11111</data>
55+
<data key="sort_order">1</data>
56+
<data key="price">10</data>
57+
<data key="price_type">fixed</data>
58+
</entity>
59+
<entity name="ProductOptionValueDropdownLongTitle2" type="product_option_value">
60+
<data key="title">Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj22222Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj22222</data>
61+
<data key="sort_order">2</data>
62+
<data key="price">20</data>
63+
<data key="price_type">percent</data>
64+
</entity>
65+
</entities>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="StorefrontProductInfoDetailsSection">
1212
<element name="productNameForReview" type="text" selector=".legend.review-legend>strong" />
13+
<element name="detailsTab" type="button" selector="#tab-label-description-title" />
1314
</section>
1415
</sections>

0 commit comments

Comments
 (0)