Skip to content

Commit 18fd2af

Browse files
committed
Merge remote-tracking branch 'origin/MC-31168' into 2.3-develop-pr114
2 parents 4ff795e + 0d8de25 commit 18fd2af

File tree

80 files changed

+2862
-447
lines changed

Some content is hidden

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

80 files changed

+2862
-447
lines changed

app/code/Magento/Authorizenet/etc/adminhtml/system.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<section id="payment">
1111
<group id="authorizenet_directpost" translate="label" type="text" sortOrder="34" showInDefault="1" showInWebsite="1" showInStore="1">
1212
<label>Authorize.Net Direct Post (Deprecated)</label>
13+
<attribute type="displayIn">deprecated_payment_methods</attribute>
1314
<field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
1415
<label>Enabled</label>
1516
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>

app/code/Magento/AuthorizenetAcceptjs/etc/adminhtml/system.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<section id="payment">
1111
<group id="authorizenet_acceptjs" translate="label" type="text" sortOrder="34" showInDefault="1" showInWebsite="1" showInStore="1">
1212
<label>Authorize.Net (Deprecated)</label>
13+
<attribute type="displayIn">deprecated_payment_methods</attribute>
1314
<field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
1415
<label>Enabled</label>
1516
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,28 @@
101101
<entity name="ProductAttributeOptionTwoForExportImport" extends="productAttributeOption2" type="ProductAttributeOption">
102102
<data key="label">option2</data>
103103
</entity>
104+
<entity name="ProductAttributeOption10" type="ProductAttributeOption">
105+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
106+
<data key="label" unique="suffix">3.5</data>
107+
<data key="value" unique="suffix">3.5</data>
108+
<data key="is_default">false</data>
109+
<data key="sort_order">1</data>
110+
<requiredEntity type="StoreLabel">Option12Store1</requiredEntity>
111+
</entity>
112+
<entity name="ProductAttributeOption11" type="ProductAttributeOption">
113+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
114+
<data key="label" unique="suffix">10.12</data>
115+
<data key="value" unique="suffix">10.12</data>
116+
<data key="is_default">false</data>
117+
<data key="sort_order">2</data>
118+
<requiredEntity type="StoreLabel">Option13Store1</requiredEntity>
119+
</entity>
120+
<entity name="ProductAttributeOption12" type="ProductAttributeOption">
121+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
122+
<data key="label" unique="suffix">36</data>
123+
<data key="value" unique="suffix">36</data>
124+
<data key="is_default">false</data>
125+
<data key="sort_order">3</data>
126+
<requiredEntity type="StoreLabel">Option14Store1</requiredEntity>
127+
</entity>
104128
</entities>

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,16 @@
8080
<data key="store_id">1</data>
8181
<data key="label">Blue</data>
8282
</entity>
83+
<entity name="Option12Store1" type="StoreLabel">
84+
<data key="store_id">1</data>
85+
<data key="label">3.5</data>
86+
</entity>
87+
<entity name="Option13Store1" type="StoreLabel">
88+
<data key="store_id">1</data>
89+
<data key="label">10.12</data>
90+
</entity>
91+
<entity name="Option14Store1" type="StoreLabel">
92+
<data key="store_id">1</data>
93+
<data key="label">36</data>
94+
</entity>
8395
</entities>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminProductMultiselectAttributeSection">
12+
<element name="option" type="text" selector="//option[contains(@data-title,'{{value}}')]" parameterized="true"/>
13+
</section>
14+
</sections>

app/code/Magento/CatalogGraphQl/Model/Resolver/Category/Image.php

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
use Magento\Framework\Exception\LocalizedException;
1414
use Magento\Store\Api\Data\StoreInterface;
1515
use Magento\Framework\Filesystem\DirectoryList;
16+
use Magento\Catalog\Model\Category\FileInfo;
17+
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
1618

1719
/**
1820
* Resolve category image to a fully qualified URL
@@ -22,12 +24,19 @@ class Image implements ResolverInterface
2224
/** @var DirectoryList */
2325
private $directoryList;
2426

27+
/** @var FileInfo */
28+
private $fileInfo;
29+
2530
/**
2631
* @param DirectoryList $directoryList
32+
* @param FileInfo $fileInfo
2733
*/
28-
public function __construct(DirectoryList $directoryList)
29-
{
34+
public function __construct(
35+
DirectoryList $directoryList,
36+
FileInfo $fileInfo
37+
) {
3038
$this->directoryList = $directoryList;
39+
$this->fileInfo = $fileInfo;
3140
}
3241

3342
/**
@@ -45,21 +54,40 @@ public function resolve(
4554
}
4655
/** @var \Magento\Catalog\Model\Category $category */
4756
$category = $value['model'];
48-
$imagePath = $category->getImage();
57+
$imagePath = $category->getData('image');
4958
if (empty($imagePath)) {
5059
return null;
5160
}
5261
/** @var StoreInterface $store */
5362
$store = $context->getExtensionAttributes()->getStore();
54-
$baseUrl = $store->getBaseUrl('media');
63+
$baseUrl = $store->getBaseUrl();
5564

56-
$mediaPath = $this->directoryList->getUrlPath('media');
57-
$pos = strpos($imagePath, $mediaPath);
58-
if ($pos !== false) {
59-
$imagePath = substr($imagePath, $pos + strlen($mediaPath), strlen($baseUrl));
65+
$filenameWithMedia = $this->fileInfo->isBeginsWithMediaDirectoryPath($imagePath)
66+
? $imagePath : $this->formatFileNameWithMediaCategoryFolder($imagePath);
67+
68+
if (!$this->fileInfo->isExist($filenameWithMedia)) {
69+
throw new GraphQlInputException(__('Category image not found.'));
6070
}
61-
$imageUrl = rtrim($baseUrl, '/') . '/' . ltrim($imagePath, '/');
6271

63-
return $imageUrl;
72+
// return full url
73+
return rtrim($baseUrl, '/') . $filenameWithMedia;
74+
}
75+
76+
/**
77+
* Format category media folder to filename
78+
*
79+
* @param string $fileName
80+
* @return string
81+
*/
82+
private function formatFileNameWithMediaCategoryFolder(string $fileName): string
83+
{
84+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
85+
$baseFileName = basename($fileName);
86+
return '/'
87+
. $this->directoryList->getUrlPath('media')
88+
. '/'
89+
. ltrim(FileInfo::ENTITY_MEDIA_PATH, '/')
90+
. '/'
91+
. $baseFileName;
6492
}
6593
}

app/code/Magento/Elasticsearch/Block/Adminhtml/System/Config/Elasticsearch5/TestConnection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
/**
99
* Elasticsearch 5x test connection block
1010
* @codeCoverageIgnore
11+
* @deprecated because of EOL for Elasticsearch5
1112
*/
1213
class TestConnection extends \Magento\AdvancedSearch\Block\Adminhtml\System\Config\TestConnection
1314
{
1415
/**
15-
* {@inheritdoc}
16+
* @inheritdoc
1617
*/
1718
protected function _getFieldMapping()
1819
{

app/code/Magento/Elasticsearch/Block/Adminhtml/System/Config/TestConnection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
/**
99
* Elasticsearch test connection block
1010
* @codeCoverageIgnore
11+
* @deprecated because of EOL for Elasticsearch2
1112
*/
1213
class TestConnection extends \Magento\AdvancedSearch\Block\Adminhtml\System\Config\TestConnection
1314
{
1415
/**
15-
* {@inheritdoc}
16+
* @inheritdoc
1617
*/
1718
protected function _getFieldMapping()
1819
{

app/code/Magento/Elasticsearch/Elasticsearch5/Model/Client/Elasticsearch.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
/**
1212
* Elasticsearch client
13+
*
14+
* @deprecated the Elasticsearch 5 doesn't supported due to EOL
1315
*/
1416
class Elasticsearch implements ClientInterface
1517
{

app/code/Magento/Elasticsearch/Elasticsearch5/SearchAdapter/Aggregation/Interval.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function __construct(
8787
}
8888

8989
/**
90-
* {@inheritdoc}
90+
* @inheritdoc
9191
*/
9292
public function load($limit, $offset = null, $lower = null, $upper = null)
9393
{
@@ -116,7 +116,7 @@ public function load($limit, $offset = null, $lower = null, $upper = null)
116116
}
117117

118118
/**
119-
* {@inheritdoc}
119+
* @inheritdoc
120120
*/
121121
public function loadPrevious($data, $index, $lower = null)
122122
{
@@ -141,11 +141,15 @@ public function loadPrevious($data, $index, $lower = null)
141141
return false;
142142
}
143143

144+
if (is_array($offset)) {
145+
$offset = $offset['value'];
146+
}
147+
144148
return $this->load($index - $offset + 1, $offset - 1, $lower);
145149
}
146150

147151
/**
148-
* {@inheritdoc}
152+
* @inheritdoc
149153
*/
150154
public function loadNext($data, $rightIndex, $upper = null)
151155
{
@@ -166,6 +170,10 @@ public function loadNext($data, $rightIndex, $upper = null)
166170
return false;
167171
}
168172

173+
if (is_array($offset)) {
174+
$offset = $offset['value'];
175+
}
176+
169177
$from = ['gte' => $data - self::DELTA];
170178
if ($upper !== null) {
171179
$to = ['lt' => $data - self::DELTA];

0 commit comments

Comments
 (0)