Skip to content

Commit 0c83a26

Browse files
committed
Merge branch '2.3-develop' into MC-930-Row-Appearances
2 parents be8d0e3 + de27216 commit 0c83a26

File tree

116 files changed

+1389
-693
lines changed

Some content is hidden

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

116 files changed

+1389
-693
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/Braintree/Setup/Patch/Data/ConvertSerializedDataToJson.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use Magento\Framework\Setup\Patch\PatchVersionInterface;
1313

1414
/**
15-
* Convert data fro php native serialized data to JSON.
15+
* Convert data from php native serialized data to JSON.
1616
*/
1717
class ConvertSerializedDataToJson implements DataPatchInterface, PatchVersionInterface
1818
{

app/code/Magento/Braintree/view/frontend/web/template/payment/paypal.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()" />
1313
<label class="label" data-bind="attr: {'for': getCode()}">
1414
<!-- PayPal Logo -->
15-
<img data-bind="attr: {src: getPaymentAcceptanceMarkSrc(), alt: $t('Acceptance Mark')}"
15+
<img data-bind="attr: {src: getPaymentAcceptanceMarkSrc(), alt: $t('Acceptance Mark')}, title: $t('Acceptance Mark')}"
1616
class="payment-icon"/>
1717
<!-- PayPal Logo -->
1818
<span text="getTitle()"></span>

app/code/Magento/Bundle/Test/Unit/Pricing/Price/BundleSelectionPriceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ protected function setupSelectionPrice($useRegularPrice = false)
121121
}
122122

123123
/**
124-
* test fro method getValue with dynamic productType
124+
* Test for method getValue with dynamic productType
125125
*
126126
* @param bool $useRegularPrice
127127
* @dataProvider useRegularPriceDataProvider

app/code/Magento/Captcha/view/frontend/web/template/checkout/captcha.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<div class="control captcha-image">
1616
<img data-bind="attr: {
1717
alt: $t('Please type the letters and numbers below'),
18+
title: $t('Please type the letters and numbers below'),
1819
height: imageHeight(),
1920
src: getImageSource(),
2021
}"

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);
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Catalog\Model\Product\Configuration\Item;
9+
10+
use Magento\Catalog\Api\Data\ProductInterface;
11+
use Magento\Framework\App\ObjectManager;
12+
13+
/**
14+
* {@inheritdoc}
15+
*/
16+
class ItemResolverComposite implements ItemResolverInterface
17+
{
18+
/** @var string[] */
19+
private $itemResolvers = [];
20+
21+
/** @var ItemResolverInterface[] */
22+
private $itemResolversInstances = [];
23+
24+
/**
25+
* @param string[] $itemResolvers
26+
*/
27+
public function __construct(array $itemResolvers)
28+
{
29+
$this->itemResolvers = $itemResolvers;
30+
}
31+
32+
/**
33+
* {@inheritdoc}
34+
*/
35+
public function getFinalProduct(ItemInterface $item) : ProductInterface
36+
{
37+
$finalProduct = $item->getProduct();
38+
foreach ($this->itemResolvers as $resolver) {
39+
$resolvedProduct = $this->getItemResolverInstance($resolver)->getFinalProduct($item);
40+
if ($resolvedProduct !== $finalProduct) {
41+
$finalProduct = $resolvedProduct;
42+
break;
43+
}
44+
}
45+
return $finalProduct;
46+
}
47+
48+
/**
49+
* Get the instance of the item resolver by class name.
50+
*
51+
* @param string $className
52+
* @return ItemResolverInterface
53+
*/
54+
private function getItemResolverInstance(string $className) : ItemResolverInterface
55+
{
56+
if (!isset($this->itemResolversInstances[$className])) {
57+
$this->itemResolversInstances[$className] = ObjectManager::getInstance()->get($className);
58+
}
59+
return $this->itemResolversInstances[$className];
60+
}
61+
}

0 commit comments

Comments
 (0)