Skip to content

Commit 6b104b0

Browse files
committed
Merge branch '2.3-develop' into MAGETWO-86867-cleanup
2 parents fe2dcff + eaa8525 commit 6b104b0

File tree

91 files changed

+1458
-336
lines changed

Some content is hidden

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

91 files changed

+1458
-336
lines changed

.github/CONTRIBUTING.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
# Contributing to Magento 2 code
22

33
Contributions to the Magento 2 codebase are done using the fork & pull model.
4-
This contribution model has contributors maintaining their own copy of the forked codebase (which can easily be synced with the main copy). The forked repository is then used to submit a request to the base repository to “pull” a set of changes (hence the phrase “pull request”).
4+
This contribution model has contributors maintaining their own copy of the forked codebase (which can easily be synced with the main copy). The forked repository is then used to submit a request to the base repository to “pull” a set of changes. For more information on pull requests please refer to [GitHub Help](https://help.github.com/articles/about-pull-requests/).
55

6-
Contributions can take the form of new components/features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes, optimizations or just good suggestions.
6+
Contributions can take the form of new components or features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes or optimizations.
77

8-
The Magento 2 development team will review all issues and contributions submitted by the community of developers in the first in, first out order. During the review we might require clarifications from the contributor. If there is no response from the contributor for two weeks, the issue is closed.
8+
The Magento 2 development team will review all issues and contributions submitted by the community of developers in the first in, first out order. During the review we might require clarifications from the contributor. If there is no response from the contributor within two weeks, the pull request will be closed.
99

1010

1111
## Contribution requirements
1212

13-
1. Contributions must adhere to [Magento coding standards](http://devdocs.magento.com/guides/v2.0/coding-standards/bk-coding-standards.html).
14-
2. Pull requests (PRs) must be accompanied by a meaningful description of their purpose. Comprehensive descriptions increase the chances of a pull request to be merged quickly and without additional clarification requests.
15-
3. Commits must be accompanied by meaningful commit messages.
16-
4. PRs which include bug fixing, must be accompanied with step-by-step description of how to reproduce the bug.
13+
1. Contributions must adhere to the [Magento coding standards](https://devdocs.magento.com/guides/v2.2/coding-standards/bk-coding-standards.html).
14+
2. Pull requests (PRs) must be accompanied by a meaningful description of their purpose. Comprehensive descriptions increase the chances of a pull request being merged quickly and without additional clarification requests.
15+
3. Commits must be accompanied by meaningful commit messages. Please see the [Magento Pull Request Template](https://github.com/magento/magento2/blob/2.2-develop/.github/PULL_REQUEST_TEMPLATE.md) for more information.
16+
4. PRs which include bug fixes must be accompanied with a step-by-step description of how to reproduce the bug.
1717
3. PRs which include new logic or new features must be submitted along with:
18-
* Unit/integration test coverage (we will be releasing more information on writing test coverage in the near future).
19-
* Proposed [documentation](http://devdocs.magento.com) update. Documentation contributions can be submitted [here](https://github.com/magento/devdocs).
20-
4. For large features or changes, please [open an issue](https://github.com/magento/magento2/issues) and discuss first. This may prevent duplicate or unnecessary effort, and it may gain you some additional contributors.
21-
5. All automated tests are passed successfully (all builds on [Travis CI](https://travis-ci.org/magento/magento2) must be green).
18+
* Unit/integration test coverage
19+
* Proposed [documentation](http://devdocs.magento.com) updates. Documentation contributions can be submitted via the [devdocs GitHub](https://github.com/magento/devdocs).
20+
4. For larger features or changes, please [open an issue](https://github.com/magento/magento2/issues) to discuss the proposed changes prior to development. This may prevent duplicate or unnecessary effort and allow other contributors to provide input.
21+
5. All automated tests must pass (all builds on [Travis CI](https://travis-ci.org/magento/magento2) must be green).
2222

2323
## Contribution process
2424

25-
If you are a new GitHub user, we recommend that you create your own [free github account](https://github.com/signup/free). By doing that, you will be able to collaborate with the Magento 2 development team, fork the Magento 2 project and be able to easily send pull requests.
25+
If you are a new GitHub user, we recommend that you create your own [free github account](https://github.com/signup/free). This will allow you to collaborate with the Magento 2 development team, fork the Magento 2 project and send pull requests.
2626

2727
1. Search current [listed issues](https://github.com/magento/magento2/issues) (open or closed) for similar proposals of intended contribution before starting work on a new contribution.
2828
2. Review the [Contributor License Agreement](https://magento.com/legaldocuments/mca) if this is your first time contributing.
2929
3. Create and test your work.
30-
4. Fork the Magento 2 repository according to [Fork a repository instructions](http://devdocs.magento.com/guides/v2.0/contributor-guide/contributing.html#fork) and when you are ready to send us a pull request – follow [Create a pull request instructions](http://devdocs.magento.com/guides/v2.0/contributor-guide/contributing.html#pull_request).
31-
5. Once your contribution is received, Magento 2 development team will review the contribution and collaborate with you as needed to improve the quality of the contribution.
30+
4. Fork the Magento 2 repository according to the [Fork A Repository instructions](http://devdocs.magento.com/guides/v2.2/contributor-guide/contributing.html#fork) and when you are ready to send us a pull request – follow the [Create A Pull Request instructions](http://devdocs.magento.com/guides/v2.2/contributor-guide/contributing.html#pull_request).
31+
5. Once your contribution is received the Magento 2 development team will review the contribution and collaborate with you as needed.
3232

3333
## Code of Conduct
3434

.github/ISSUE_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828

2929
### Expected result
3030
<!--- Tell us what should happen -->
31-
1. [Screenshot, logs]
31+
1. [Screenshots, logs or description]
3232

3333
### Actual result
3434
<!--- Tell us what happens instead -->
35-
1. [Screenshot, logs]
35+
1. [Screenshots, logs or description]

app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message/ListAction.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ public function execute()
6262
if (empty($result)) {
6363
$result[] = [
6464
'severity' => (string)\Magento\Framework\Notification\MessageInterface::SEVERITY_NOTICE,
65-
'text' => 'You have viewed and resolved all recent system notices. '
66-
. 'Please refresh the web page to clear the notice alert.',
65+
'text' => __(
66+
'You have viewed and resolved all recent system notices. '
67+
. 'Please refresh the web page to clear the notice alert.'
68+
)
6769
];
6870
}
6971
/** @var \Magento\Framework\Controller\Result\Json $resultJson */

app/code/Magento/AdminNotification/i18n/en_US.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@ Severity,Severity
4848
"Date Added","Date Added"
4949
Message,Message
5050
Actions,Actions
51+
"You have viewed and resolved all recent system notices. Please refresh the web page to clear the notice alert.","You have viewed and resolved all recent system notices. Please refresh the web page to clear the notice alert."

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,16 @@
139139
<type name="Magento\Backend\Model\Menu\Builder">
140140
<plugin name="SetupMenuBuilder" type="Magento\Backend\Model\Setup\MenuBuilder" />
141141
</type>
142-
<type name="Magento\Config\Model\Config\Structure\ConcealInProductionConfigList">
142+
<type name="Magento\Config\Model\Config\Structure\ElementVisibility\ConcealInProduction">
143143
<arguments>
144144
<argument name="configs" xsi:type="array">
145145
<item name="dev" xsi:type="const">Magento\Config\Model\Config\Structure\ElementVisibilityInterface::HIDDEN</item>
146+
</argument>
147+
</arguments>
148+
</type>
149+
<type name="Magento\Config\Model\Config\Structure\ElementVisibility\ConcealInProductionWithoutScdOnDemand">
150+
<arguments>
151+
<argument name="configs" xsi:type="array">
146152
<item name="general/locale/code" xsi:type="const">Magento\Config\Model\Config\Structure\ElementVisibilityInterface::DISABLED</item>
147153
</argument>
148154
</arguments>

app/code/Magento/Braintree/Test/Unit/Gateway/Response/PayPal/VaultDetailsHandlerTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ protected function setUp()
8888

8989
$this->paymentInfoMock = $this->getMockBuilder(Payment::class)
9090
->disableOriginalConstructor()
91-
->setMethods(['__wakeup'])
91+
->setMethods(['__wakeup', 'getExtensionAttributes'])
9292
->getMock();
9393

9494
$this->paymentTokenMock = $objectManager->getObject(PaymentToken::class);
@@ -107,6 +107,10 @@ protected function setUp()
107107
->setMethods(['create'])
108108
->getMock();
109109

110+
$this->paymentInfoMock->expects(self::any())
111+
->method('getExtensionAttributes')
112+
->willReturn($this->paymentExtensionMock);
113+
110114
$this->subject = [
111115
'payment' => $this->paymentDataObjectMock,
112116
];
@@ -184,7 +188,7 @@ public function testHandleWithoutToken()
184188
->method('create');
185189

186190
$this->handler->handle($this->subject, $response);
187-
self::assertNull($this->paymentInfoMock->getExtensionAttributes());
191+
self::assertNotNull($this->paymentInfoMock->getExtensionAttributes());
188192
}
189193

190194
/**

app/code/Magento/Braintree/Test/Unit/Gateway/Response/VaultDetailsHandlerTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ protected function setUp()
8080

8181
$this->payment = $this->getMockBuilder(Payment::class)
8282
->disableOriginalConstructor()
83-
->setMethods(['__wakeup'])
83+
->setMethods(['__wakeup', 'getExtensionAttributes'])
8484
->getMock();
8585

86+
$this->payment->expects(self::any())->method('getExtensionAttributes')->willReturn($this->paymentExtension);
87+
8688
$config = $this->getConfigMock();
8789

8890
$this->paymentHandler = new VaultDetailsHandler(

app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/QuoteUpdaterTest.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Magento\Braintree\Observer\DataAssignObserver;
1414
use Magento\Braintree\Gateway\Config\PayPal\Config;
1515
use Magento\Braintree\Model\Paypal\Helper\QuoteUpdater;
16+
use Magento\Quote\Api\Data\CartExtensionInterface;
1617

1718
/**
1819
* Class QuoteUpdaterTest
@@ -281,7 +282,7 @@ private function updateQuoteStep(\PHPUnit_Framework_MockObject_MockObject $quote
281282
*/
282283
private function getQuoteMock()
283284
{
284-
return $this->getMockBuilder(Quote::class)
285+
$quoteMock = $this->getMockBuilder(Quote::class)
285286
->setMethods(
286287
[
287288
'getIsVirtual',
@@ -291,9 +292,21 @@ private function getQuoteMock()
291292
'collectTotals',
292293
'getShippingAddress',
293294
'getBillingAddress',
295+
'getExtensionAttributes'
294296
]
295297
)->disableOriginalConstructor()
296298
->getMock();
299+
300+
$cartExtensionMock = $this->getMockBuilder(CartExtensionInterface::class)
301+
->setMethods(['setShippingAssignments'])
302+
->disableOriginalConstructor()
303+
->getMock();
304+
305+
$quoteMock->expects(self::any())
306+
->method('getExtensionAttributes')
307+
->willReturn($cartExtensionMock);
308+
309+
return $quoteMock;
297310
}
298311

299312
/**

app/code/Magento/BundleImportExport/Model/Import/Product/Type/Bundle.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ public function saveData()
411411
$this->populateExistingOptions();
412412
$this->insertOptions();
413413
$this->insertSelections();
414+
$this->insertParentChildRelations();
414415
$this->clear();
415416
}
416417
}
@@ -659,6 +660,32 @@ protected function insertSelections()
659660
return $this;
660661
}
661662

663+
/**
664+
* Insert parent/child product relations
665+
*
666+
* @return \Magento\CatalogImportExport\Model\Import\Product\Type\AbstractType
667+
*/
668+
private function insertParentChildRelations()
669+
{
670+
foreach ($this->_cachedOptions as $productId => $options) {
671+
$childIds = [];
672+
foreach ($options as $option) {
673+
foreach ($option['selections'] as $selection) {
674+
if (!isset($selection['parent_product_id'])) {
675+
if (!isset($this->_cachedSkuToProducts[$selection['sku']])) {
676+
continue;
677+
}
678+
$childIds[] = $this->_cachedSkuToProducts[$selection['sku']];
679+
}
680+
}
681+
682+
$this->relationsDataSaver->saveProductRelations($productId, $childIds);
683+
}
684+
}
685+
686+
return $this;
687+
}
688+
662689
/**
663690
* Initialize attributes parameters for all attributes' sets.
664691
*

app/code/Magento/BundleImportExport/Model/Import/Product/Type/Bundle/RelationsDataSaver.php

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
*/
66
namespace Magento\BundleImportExport\Model\Import\Product\Type\Bundle;
77

8+
use Magento\Catalog\Model\ResourceModel\Product\Relation;
9+
use Magento\Framework\App\ObjectManager;
10+
811
/**
912
* A bundle product relations (options, selections, etc.) data saver.
1013
*
@@ -17,13 +20,22 @@ class RelationsDataSaver
1720
*/
1821
private $resource;
1922

23+
/**
24+
* @var Relation
25+
*/
26+
private $productRelation;
27+
2028
/**
2129
* @param \Magento\Framework\App\ResourceConnection $resource
30+
* @param Relation $productRelation
2231
*/
2332
public function __construct(
24-
\Magento\Framework\App\ResourceConnection $resource
33+
\Magento\Framework\App\ResourceConnection $resource,
34+
Relation $productRelation = null
2535
) {
26-
$this->resource = $resource;
36+
$this->resource = $resource;
37+
$this->productRelation = $productRelation
38+
?: ObjectManager::getInstance()->get(Relation::class);
2739
}
2840

2941
/**
@@ -92,4 +104,17 @@ public function saveSelections(array $selections)
92104
);
93105
}
94106
}
107+
108+
/**
109+
* Saves given parent/child relations.
110+
*
111+
* @param int $parentId
112+
* @param array $childIds
113+
*
114+
* @return void
115+
*/
116+
public function saveProductRelations($parentId, $childIds)
117+
{
118+
$this->productRelation->processRelations($parentId, $childIds);
119+
}
95120
}

0 commit comments

Comments
 (0)