Skip to content

Commit d5e69fc

Browse files
committed
Merge remote-tracking branch 'engcom/libs-upgrade' into MAGETWO-89082-update-composer-dependencies
- fix conflicts
2 parents a97a662 + d93c04c commit d5e69fc

File tree

198 files changed

+5307
-1196
lines changed

Some content is hidden

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

198 files changed

+5307
-1196
lines changed

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MassRemove.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ public function execute()
3939
$this->messageManager->addException($e, __("We couldn't remove the messages because of an error."));
4040
}
4141
}
42-
$this->getResponse()->setRedirect($this->_redirect->getRedirectUrl($this->getUrl('*')));
42+
$this->_redirect('adminhtml/*/');
4343
}
4444
}

app/code/Magento/Braintree/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"require": {
88
"php": "~7.1.3||~7.2.0",
9-
"braintree/braintree_php": "3.22.0",
9+
"braintree/braintree_php": "3.28.0",
1010
"magento/framework": "100.3.*",
1111
"magento/magento-composer-installer": "*",
1212
"magento/module-catalog": "101.2.*",

app/code/Magento/Catalog/Block/Product/Image.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,19 @@
2020
class Image extends \Magento\Framework\View\Element\Template
2121
{
2222
/**
23+
* @deprecated Property isn't used
2324
* @var \Magento\Catalog\Helper\Image
2425
*/
2526
protected $imageHelper;
2627

2728
/**
29+
* @deprecated Property isn't used
2830
* @var \Magento\Catalog\Model\Product
2931
*/
3032
protected $product;
3133

3234
/**
35+
* @deprecated Property isn't used
3336
* @var array
3437
*/
3538
protected $attributes = [];

app/code/Magento/Catalog/Console/Command/ImagesResizeCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ protected function execute(
6969
$productIds = $productCollection->getAllIds();
7070
if (!count($productIds)) {
7171
$output->writeln("<info>No product images to resize</info>");
72-
// we must have an exit code higher than zero to indicate something was wrong
7372
return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
7473
}
7574

app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ public function execute()
113113
$options
114114
);
115115
$valueOptions = (isset($options['value']) && is_array($options['value'])) ? $options['value'] : [];
116+
foreach (array_keys($valueOptions) as $key) {
117+
if (!empty($options['delete'][$key])) {
118+
unset($valueOptions[$key]);
119+
}
120+
}
116121
$this->checkEmptyOption($response, $valueOptions);
117122
}
118123

app/code/Magento/Catalog/Helper/Product/Configuration.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Catalog\Helper\Product;
77

88
use Magento\Framework\App\ObjectManager;
9+
use Magento\Framework\Escaper;
910
use Magento\Framework\Serialize\Serializer\Json;
1011
use Magento\Catalog\Helper\Product\Configuration\ConfigurationInterface;
1112
use Magento\Framework\App\Helper\AbstractHelper;
@@ -43,6 +44,11 @@ class Configuration extends AbstractHelper implements ConfigurationInterface
4344
*/
4445
private $serializer;
4546

47+
/**
48+
* @var Escaper
49+
*/
50+
private $escaper;
51+
4652
/**
4753
* @param \Magento\Framework\App\Helper\Context $context
4854
* @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory
@@ -55,12 +61,14 @@ public function __construct(
5561
\Magento\Catalog\Model\Product\OptionFactory $productOptionFactory,
5662
\Magento\Framework\Filter\FilterManager $filter,
5763
\Magento\Framework\Stdlib\StringUtils $string,
58-
Json $serializer = null
64+
Json $serializer = null,
65+
Escaper $escaper = null
5966
) {
6067
$this->_productOptionFactory = $productOptionFactory;
6168
$this->filter = $filter;
6269
$this->string = $string;
6370
$this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class);
71+
$this->escaper = $escaper ?: ObjectManager::getInstance()->get(Escaper::class);
6472
parent::__construct($context);
6573
}
6674

@@ -175,7 +183,7 @@ public function getFormattedOptionValue($optionValue, $params = null)
175183
if (isset($optionValue['option_id'])) {
176184
$optionInfo = $optionValue;
177185
if (isset($optionInfo['value'])) {
178-
$optionValue = $optionInfo['value'];
186+
$optionValue = $this->escaper->escapeHtml($optionInfo['value']);
179187
}
180188
} elseif (isset($optionValue['value'])) {
181189
$optionValue = $optionValue['value'];
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magento\Catalog\Model\Config\Source;
10+
11+
use Magento\Catalog\Model\Product\Attribute\Source\Layout;
12+
13+
/**
14+
* Returns layout list for Web>Default Layouts>Default Product Layout/Default Category Layout
15+
*/
16+
class LayoutList implements \Magento\Framework\Option\ArrayInterface
17+
{
18+
/**
19+
* @var array
20+
*/
21+
private $options;
22+
23+
/**
24+
* @var \Magento\Catalog\Model\Product\Attribute\Source\Layout
25+
*/
26+
private $layoutSource;
27+
28+
/**
29+
* @param Layout $layoutSource
30+
*/
31+
public function __construct(
32+
Layout $layoutSource
33+
) {
34+
$this->layoutSource = $layoutSource;
35+
}
36+
37+
/**
38+
* To option array
39+
*
40+
* @return array
41+
*/
42+
public function toOptionArray()
43+
{
44+
if (!$this->options) {
45+
$this->options = $this->layoutSource->getAllOptions();
46+
}
47+
return $this->options;
48+
}
49+
}

app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ protected function modifyPriceData($object, $data)
358358
{
359359
/** @var array $priceItem */
360360
foreach ($data as $key => $priceItem) {
361-
if (isset($priceItem['price']) && $priceItem['price'] > 0) {
361+
if (array_key_exists('price', $priceItem)) {
362362
$data[$key]['website_price'] = $priceItem['price'];
363363
}
364364
if ($priceItem['all_groups']) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function getDefaultStoreId()
140140
*
141141
* @param string $table
142142
* @param array|int $attributeIds
143-
* @return \Magento\Eav\Model\Entity\Collection\AbstractCollection
143+
* @return \Magento\Framework\DB\Select
144144
*/
145145
protected function _getLoadAttributesSelect($table, $attributeIds = [])
146146
{

app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Attribute/ValidateTest.php

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,20 @@ public function provideUniqueData()
249249
]
250250
], false
251251
],
252+
'empty and deleted' => [
253+
[
254+
'value' => [
255+
"option_0" => [1, 0],
256+
"option_1" => [2, 0],
257+
"option_2" => ["", ""],
258+
],
259+
'delete' => [
260+
"option_0" => "",
261+
"option_1" => "",
262+
"option_2" => "1",
263+
]
264+
], false
265+
],
252266
];
253267
}
254268

@@ -321,7 +335,34 @@ public function provideEmptyOption()
321335
(object) [
322336
'error' => false,
323337
]
324-
]
338+
],
339+
'empty admin scope options and deleted' => [
340+
[
341+
'value' => [
342+
"option_0" => [''],
343+
],
344+
'delete' => [
345+
'option_0' => '1',
346+
],
347+
],
348+
(object) [
349+
'error' => false,
350+
],
351+
],
352+
'empty admin scope options and not deleted' => [
353+
[
354+
'value' => [
355+
"option_0" => [''],
356+
],
357+
'delete' => [
358+
'option_0' => '0',
359+
],
360+
],
361+
(object) [
362+
'error' => true,
363+
'message' => 'The value of Admin scope can\'t be empty.',
364+
],
365+
],
325366
];
326367
}
327368
}

0 commit comments

Comments
 (0)