Skip to content

Commit 880bab5

Browse files
author
Vaha
committed
Merge branch 'origin-2.3-develop' into 23627-order-get-customer-name-improvements
2 parents bff0d38 + ff2fa21 commit 880bab5

File tree

306 files changed

+7429
-2336
lines changed

Some content is hidden

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

306 files changed

+7429
-2336
lines changed

app/code/Magento/Analytics/Model/ExportDataHandler.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function __construct(
8989
public function prepareExportData()
9090
{
9191
try {
92-
$tmpDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::SYS_TMP);
92+
$tmpDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::VAR_DIR);
9393

9494
$this->prepareDirectory($tmpDirectory, $this->getTmpFilesDirRelativePath());
9595
$this->reportWriter->write($tmpDirectory, $this->getTmpFilesDirRelativePath());
@@ -157,7 +157,9 @@ private function prepareDirectory(WriteInterface $directory, $path)
157157
private function prepareFileDirectory(WriteInterface $directory, $path)
158158
{
159159
$directory->delete($path);
160+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
160161
if (dirname($path) !== '.') {
162+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
161163
$directory->create(dirname($path));
162164
}
163165

@@ -176,6 +178,7 @@ private function pack($source, $destination)
176178
$this->archive->pack(
177179
$source,
178180
$destination,
181+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
179182
is_dir($source) ?: false
180183
);
181184

app/code/Magento/Analytics/Test/Unit/Model/ExportDataHandlerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use Magento\Framework\Archive;
1414
use Magento\Framework\Filesystem;
1515
use Magento\Framework\Filesystem\Directory\WriteInterface;
16-
use Magento\Framework\Filesystem\DirectoryList;
16+
use Magento\Framework\App\Filesystem\DirectoryList;
1717
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
1818

1919
class ExportDataHandlerTest extends \PHPUnit\Framework\TestCase
@@ -137,7 +137,7 @@ public function testPrepareExportData($isArchiveSourceDirectory)
137137
$this->filesystemMock
138138
->expects($this->once())
139139
->method('getDirectoryWrite')
140-
->with(DirectoryList::SYS_TMP)
140+
->with(DirectoryList::VAR_DIR)
141141
->willReturn($this->directoryMock);
142142
$this->directoryMock
143143
->expects($this->exactly(4))
@@ -238,7 +238,7 @@ public function testPrepareExportDataWithLocalizedException()
238238
$this->filesystemMock
239239
->expects($this->once())
240240
->method('getDirectoryWrite')
241-
->with(DirectoryList::SYS_TMP)
241+
->with(DirectoryList::VAR_DIR)
242242
->willReturn($this->directoryMock);
243243
$this->reportWriterMock
244244
->expects($this->once())
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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\AsynchronousOperations\Model;
9+
10+
use Magento\AsynchronousOperations\Api\Data\OperationSearchResultsInterface;
11+
use Magento\Framework\Api\SearchResults;
12+
13+
/**
14+
* Service Data Object with bulk Operation search result.
15+
*/
16+
class OperationSearchResults extends SearchResults implements OperationSearchResultsInterface
17+
{
18+
}

app/code/Magento/AsynchronousOperations/etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<preference for="Magento\AsynchronousOperations\Api\Data\SummaryOperationStatusInterface" type="Magento\AsynchronousOperations\Model\OperationStatus" />
1717
<preference for="Magento\AsynchronousOperations\Api\Data\DetailedBulkOperationsStatusInterface" type="Magento\AsynchronousOperations\Model\BulkStatus\Detailed" />
1818
<preference for="Magento\AsynchronousOperations\Api\Data\BulkOperationsStatusInterface" type="Magento\AsynchronousOperations\Model\BulkStatus\Short" />
19-
<preference for="Magento\AsynchronousOperations\Api\Data\OperationSearchResultsInterface" type="Magento\Framework\Api\SearchResults" />
19+
<preference for="Magento\AsynchronousOperations\Api\Data\OperationSearchResultsInterface" type="Magento\AsynchronousOperations\Model\OperationSearchResults" />
2020
<preference for="Magento\AsynchronousOperations\Api\OperationRepositoryInterface" type="Magento\AsynchronousOperations\Model\OperationRepository" />
2121
<type name="Magento\Framework\EntityManager\MetadataPool">
2222
<arguments>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,8 @@
323323
</field>
324324
<field id="port" translate="label comment" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
325325
<label>Port (25)</label>
326-
<comment>For Windows server only.</comment>
326+
<validate>validate-digits validate-digits-range digits-range-0-65535</validate>
327+
<comment>Please enter at least 0 and at most 65535 (For Windows server only).</comment>
327328
</field>
328329
<field id="set_return_path" translate="label" type="select" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="1">
329330
<label>Set Return-Path</label>

app/code/Magento/Backend/view/adminhtml/requirejs-config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
var config = {
77
map: {
88
'*': {
9-
'mediaUploader': 'Magento_Backend/js/media-uploader'
9+
'mediaUploader': 'Magento_Backend/js/media-uploader',
10+
'mage/translate': 'Magento_Backend/js/translate'
1011
}
1112
}
1213
};
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
/* eslint-disable strict */
7+
(function (factory) {
8+
if (typeof define === 'function' && define.amd) {
9+
define([
10+
'jquery',
11+
'mage/mage'
12+
], factory);
13+
} else {
14+
factory(jQuery);
15+
}
16+
}(function ($) {
17+
$.extend(true, $, {
18+
mage: {
19+
translate: (function () {
20+
/**
21+
* Key-value translations storage
22+
* @type {Object}
23+
* @private
24+
*/
25+
var _data = {};
26+
27+
/**
28+
* Add new translation (two string parameters) or several translations (object)
29+
*/
30+
this.add = function () {
31+
if (arguments.length > 1) {
32+
_data[arguments[0]] = arguments[1];
33+
} else if (typeof arguments[0] === 'object') {
34+
$.extend(_data, arguments[0]);
35+
}
36+
};
37+
38+
/**
39+
* Make a translation with parsing (to handle case when _data represents tuple)
40+
* @param {String} text
41+
* @return {String}
42+
*/
43+
this.translate = function (text) {
44+
return _data[text] ? _data[text] : text;
45+
};
46+
47+
return this;
48+
}())
49+
}
50+
});
51+
$.mage.__ = $.proxy($.mage.translate.translate, $.mage.translate);
52+
53+
return $.mage.__;
54+
}));
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# BraintreeGraphQl
1+
# Magento_BraintreeGraphQl module
22

3-
**BraintreeGraphQl** provides type and resolver for method additional
4-
information.
3+
The Magento_BraintreeGraphQl module provides type and resolver information for the GraphQL module to pass payment information data from the client to Magento.
4+
5+
## Extensibility
6+
7+
Extension developers can interact with the Magento_BraintreeGraphQl module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html).
8+
9+
[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_BraintreeGraphQl module.

app/code/Magento/Bundle/Model/Product/CopyConstructor/Bundle.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
use Magento\Catalog\Model\Product;
99
use Magento\Catalog\Model\Product\Type;
1010

11+
/**
12+
* Provides duplicating bundle options and selections
13+
*/
1114
class Bundle implements \Magento\Catalog\Model\Product\CopyConstructorInterface
1215
{
1316
/**
@@ -27,7 +30,17 @@ public function build(Product $product, Product $duplicate)
2730
$bundleOptions = $product->getExtensionAttributes()->getBundleProductOptions() ?: [];
2831
$duplicatedBundleOptions = [];
2932
foreach ($bundleOptions as $key => $bundleOption) {
30-
$duplicatedBundleOptions[$key] = clone $bundleOption;
33+
$duplicatedBundleOption = clone $bundleOption;
34+
/**
35+
* Set option and selection ids to 'null' in order to create new option(selection) for duplicated product,
36+
* but not modifying existing one, which led to lost of option(selection) in original product.
37+
*/
38+
$productLinks = $duplicatedBundleOption->getProductLinks() ?: [];
39+
foreach ($productLinks as $productLink) {
40+
$productLink->setSelectionId(null);
41+
}
42+
$duplicatedBundleOption->setOptionId(null);
43+
$duplicatedBundleOptions[$key] = $duplicatedBundleOption;
3144
}
3245
$duplicate->getExtensionAttributes()->setBundleProductOptions($duplicatedBundleOptions);
3346
}

app/code/Magento/Bundle/Test/Unit/Model/Product/CopyConstructor/BundleTest.php

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Bundle\Test\Unit\Model\Product\CopyConstructor;
77

88
use Magento\Bundle\Api\Data\BundleOptionInterface;
9+
use Magento\Bundle\Model\Link;
910
use Magento\Bundle\Model\Product\CopyConstructor\Bundle;
1011
use Magento\Catalog\Api\Data\ProductExtensionInterface;
1112
use Magento\Catalog\Model\Product;
@@ -45,6 +46,7 @@ public function testBuildNegative()
4546
*/
4647
public function testBuildPositive()
4748
{
49+
/** @var Product|\PHPUnit_Framework_MockObject_MockObject $product */
4850
$product = $this->getMockBuilder(Product::class)
4951
->disableOriginalConstructor()
5052
->getMock();
@@ -60,18 +62,42 @@ public function testBuildPositive()
6062
->method('getExtensionAttributes')
6163
->willReturn($extensionAttributesProduct);
6264

65+
$productLink = $this->getMockBuilder(Link::class)
66+
->setMethods(['setSelectionId'])
67+
->disableOriginalConstructor()
68+
->getMock();
69+
$productLink->expects($this->exactly(2))
70+
->method('setSelectionId')
71+
->with($this->identicalTo(null));
72+
$firstOption = $this->getMockBuilder(BundleOptionInterface::class)
73+
->setMethods(['getProductLinks'])
74+
->disableOriginalConstructor()
75+
->getMockForAbstractClass();
76+
$firstOption->expects($this->once())
77+
->method('getProductLinks')
78+
->willReturn([$productLink]);
79+
$firstOption->expects($this->once())
80+
->method('setOptionId')
81+
->with($this->identicalTo(null));
82+
$secondOption = $this->getMockBuilder(BundleOptionInterface::class)
83+
->setMethods(['getProductLinks'])
84+
->disableOriginalConstructor()
85+
->getMockForAbstractClass();
86+
$secondOption->expects($this->once())
87+
->method('getProductLinks')
88+
->willReturn([$productLink]);
89+
$secondOption->expects($this->once())
90+
->method('setOptionId')
91+
->with($this->identicalTo(null));
6392
$bundleOptions = [
64-
$this->getMockBuilder(BundleOptionInterface::class)
65-
->disableOriginalConstructor()
66-
->getMockForAbstractClass(),
67-
$this->getMockBuilder(BundleOptionInterface::class)
68-
->disableOriginalConstructor()
69-
->getMockForAbstractClass()
93+
$firstOption,
94+
$secondOption
7095
];
7196
$extensionAttributesProduct->expects($this->once())
7297
->method('getBundleProductOptions')
7398
->willReturn($bundleOptions);
7499

100+
/** @var Product|\PHPUnit_Framework_MockObject_MockObject $duplicate */
75101
$duplicate = $this->getMockBuilder(Product::class)
76102
->disableOriginalConstructor()
77103
->getMock();

0 commit comments

Comments
 (0)