Skip to content

Commit f91c5e0

Browse files
committed
Merge remote-tracking branch 'origin/MC-16769' into 2.3-develop-pr53
2 parents fe0bcdd + 21c325c commit f91c5e0

File tree

83 files changed

+2118
-1195
lines changed

Some content is hidden

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

83 files changed

+2118
-1195
lines changed

.github/CONTRIBUTING.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
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. For more information on pull requests please refer to [GitHub Help](https://help.github.com/articles/about-pull-requests/).
4+
This contribution model has contributors maintaining their own fork of the Magento 2 repository.
5+
The forked repository is then used to submit a request to the base repository to “pull” a set of changes.
6+
For more information on pull requests please refer to [GitHub Help](https://help.github.com/articles/about-pull-requests/).
57

68
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.
79

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.
10+
The Magento 2 development team or community maintainers will review all issues and contributions submitted by the community of developers in the first in, first out order.
11+
During the review we might require clarifications from the contributor.
12+
If there is no response from the contributor within two weeks, the pull request will be closed.
913

14+
For more detialed information on contribution please read our [beginners guide](https://github.com/magento/magento2/wiki/Getting-Started).
1015

1116
## Contribution requirements
1217

13-
1. Contributions must adhere to the [Magento coding standards](https://devdocs.magento.com/guides/v2.2/coding-standards/bk-coding-standards.html).
18+
1. Contributions must adhere to the [Magento coding standards](https://devdocs.magento.com/guides/v2.3/coding-standards/bk-coding-standards.html).
1419
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.
20+
3. Commits must be accompanied by meaningful commit messages. Please see the [Magento Pull Request Template](https://github.com/magento/magento2/blob/2.3-develop/.github/PULL_REQUEST_TEMPLATE.md) for more information.
1621
4. PRs which include bug fixes must be accompanied with a step-by-step description of how to reproduce the bug.
1722
3. PRs which include new logic or new features must be submitted along with:
1823
* Unit/integration test coverage
@@ -22,15 +27,22 @@ The Magento 2 development team will review all issues and contributions submitte
2227

2328
## Contribution process
2429

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.
30+
If you are a new GitHub user, we recommend that you create your own [free github account](https://github.com/signup/free).
31+
This will allow you to collaborate with the Magento 2 development team, fork the Magento 2 project and send pull requests.
2632

2733
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.
2834
2. Review the [Contributor License Agreement](https://magento.com/legaldocuments/mca) if this is your first time contributing.
2935
3. Create and test your work.
30-
4. Fork the Magento 2 repository according to the [Fork A Repository instructions](https://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](https://devdocs.magento.com/guides/v2.2/contributor-guide/contributing.html#pull_request).
36+
4. Fork the Magento 2 repository according to the [Fork A Repository instructions](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#fork) and when you are ready to send us a pull request – follow the [Create A Pull Request instructions](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#pull_request).
3137
5. Once your contribution is received the Magento 2 development team will review the contribution and collaborate with you as needed.
3238

3339
## Code of Conduct
3440

3541
Please note that this project is released with a Contributor Code of Conduct. We expect you to agree to its terms when participating in this project.
3642
The full text is available in the repository [Wiki](https://github.com/magento/magento2/wiki/Magento-Code-of-Conduct).
43+
44+
## Connecting with Community!
45+
46+
If you have any questions, join us in [#beginners](https://magentocommeng.slack.com/messages/CH8BGFX9D) Slack chat. If you are not on our slack, [click here](http://tinyurl.com/engcom-slack) to join.
47+
48+
Need to find a project? Check out the [Slack Channels](https://github.com/magento/magento2/wiki/Slack-Channels) (with listed project info) and the [Magento Community Portal](https://opensource.magento.com/).

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
There could be 1 or more issues linked here and it will help us find some more information about the reasoning behind this change.
2222
-->
2323
1. magento/magento2#<issue_number>: Issue title
24-
2. ...
2524

2625
### Manual testing scenarios (*)
2726
<!---
@@ -31,6 +30,12 @@
3130
1. ...
3231
2. ...
3332

33+
### Questions or comments
34+
<!---
35+
If relevant, here you can ask questions or provide comments on your pull request for the reviewer
36+
For example if you need assistance with writing tests or would like some feedback on one of your development ideas
37+
-->
38+
3439
### Contribution checklist (*)
3540
- [ ] Pull request has a meaningful description of its purpose
3641
- [ ] All commits are accompanied by meaningful commit messages

app/code/Magento/AuthorizenetAcceptjs/Gateway/Response/CloseTransactionHandler.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,19 @@ class CloseTransactionHandler implements HandlerInterface
2222
*/
2323
private $subjectReader;
2424

25+
/**
26+
* @var bool
27+
*/
28+
private $closeTransaction;
29+
2530
/**
2631
* @param SubjectReader $subjectReader
32+
* @param bool $closeTransaction
2733
*/
28-
public function __construct(SubjectReader $subjectReader)
34+
public function __construct(SubjectReader $subjectReader, bool $closeTransaction = true)
2935
{
3036
$this->subjectReader = $subjectReader;
37+
$this->closeTransaction = $closeTransaction;
3138
}
3239

3340
/**
@@ -39,7 +46,7 @@ public function handle(array $handlingSubject, array $response): void
3946
$payment = $paymentDO->getPayment();
4047

4148
if ($payment instanceof Payment) {
42-
$payment->setIsTransactionClosed(true);
49+
$payment->setIsTransactionClosed($this->closeTransaction);
4350
$payment->setShouldCloseParentTransaction(true);
4451
}
4552
}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,15 @@
188188
</argument>
189189
</arguments>
190190
</virtualType>
191+
<virtualType name="CloseCaptureTransactionHandler" type="Magento\AuthorizenetAcceptjs\Gateway\Response\CloseTransactionHandler">
192+
<arguments>
193+
<argument name="closeTransaction" xsi:type="boolean">false</argument>
194+
</arguments>
195+
</virtualType>
191196
<virtualType name="AuthorizenetAcceptjsCaptureTransactionHandler" type="Magento\Payment\Gateway\Response\HandlerChain">
192197
<arguments>
193198
<argument name="handlers" xsi:type="array">
194-
<item name="close_parent_transaction" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Response\CloseParentTransactionHandler</item>
199+
<item name="close_transaction" xsi:type="string">CloseCaptureTransactionHandler</item>
195200
</argument>
196201
</arguments>
197202
</virtualType>

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ define(
7979
*/
8080
onError: function (response) {
8181
braintree.showError($t('Payment ' + this.getTitle() + ' can\'t be initialized'));
82-
this.isPlaceOrderActionAllowed(true);
8382
throw response.message;
8483
},
8584

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/hosted-fields.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ define([
156156
*/
157157
placeOrderClick: function () {
158158
if (this.validateCardType() && additionalValidators.validate()) {
159-
this.isPlaceOrderActionAllowed(false);
160159
$(this.getSelector('submit')).trigger('click');
161160
}
162161
},

app/code/Magento/BundleGraphQl/etc/schema.graphqls

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
# Copyright © Magento, Inc. All rights reserved.
22
# See COPYING.txt for license details.
33

4-
type BundleItem @doc(description: "BundleItem defines an individual item in a bundle product") {
5-
option_id: Int @doc(description: "An ID assigned to each type of item in a bundle product")
6-
title: String @doc(description: "The display name of the item")
7-
required: Boolean @doc(description: "Indicates whether the item must be included in the bundle")
8-
type: String @doc(description: "The input type that the customer uses to select the item. Examples include radio button and checkbox")
9-
position: Int @doc(description: "he relative position of this item compared to the other bundle items")
10-
sku: String @doc(description: "The SKU of the bundle product")
11-
options: [BundleItemOption] @doc(description: "An array of additional options for this bundle item") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\BundleItemLinks")
4+
type BundleItem @doc(description: "BundleItem defines an individual item in a bundle product.") {
5+
option_id: Int @doc(description: "An ID assigned to each type of item in a bundle product.")
6+
title: String @doc(description: "The display name of the item.")
7+
required: Boolean @doc(description: "Indicates whether the item must be included in the bundle.")
8+
type: String @doc(description: "The input type that the customer uses to select the item. Examples include radio button and checkbox.")
9+
position: Int @doc(description: "he relative position of this item compared to the other bundle items.")
10+
sku: String @doc(description: "The SKU of the bundle product.")
11+
options: [BundleItemOption] @doc(description: "An array of additional options for this bundle item.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\BundleItemLinks")
1212
}
1313

14-
type BundleItemOption @doc(description: "BundleItemOption defines characteristics and options for a specific bundle item") {
15-
id: Int @doc(description: "The ID assigned to the bundled item option")
16-
label: String @doc(description: "The text that identifies the bundled item option") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Options\\Label")
17-
qty: Float @doc(description: "Indicates the quantity of this specific bundle item")
18-
position: Int @doc(description: "When a bundle item contains multiple options, the relative position of this option compared to the other options")
19-
is_default: Boolean @doc(description: "Indicates whether this option is the default option")
20-
price: Float @doc(description: "The price of the selected option")
21-
price_type: PriceTypeEnum @doc(description: "One of FIXED, PERCENT, or DYNAMIC")
22-
can_change_quantity: Boolean @doc(description: "Indicates whether the customer can change the number of items for this option")
23-
product: ProductInterface @doc(description: "Contains details about this product option") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product")
14+
type BundleItemOption @doc(description: "BundleItemOption defines characteristics and options for a specific bundle item.") {
15+
id: Int @doc(description: "The ID assigned to the bundled item option.")
16+
label: String @doc(description: "The text that identifies the bundled item option.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Options\\Label")
17+
qty: Float @doc(description: "Indicates the quantity of this specific bundle item.")
18+
position: Int @doc(description: "When a bundle item contains multiple options, the relative position of this option compared to the other options.")
19+
is_default: Boolean @doc(description: "Indicates whether this option is the default option.")
20+
price: Float @doc(description: "The price of the selected option.")
21+
price_type: PriceTypeEnum @doc(description: "One of FIXED, PERCENT, or DYNAMIC.")
22+
can_change_quantity: Boolean @doc(description: "Indicates whether the customer can change the number of items for this option.")
23+
product: ProductInterface @doc(description: "Contains details about this product option.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product")
2424
}
2525

26-
type BundleProduct implements ProductInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "BundleProduct defines basic features of a bundle product and contains multiple BundleItems") {
27-
price_view: PriceViewEnum @doc(description: "One of PRICE_RANGE or AS_LOW_AS") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\PriceView")
28-
dynamic_price: Boolean @doc(description: "Indicates whether the bundle product has a dynamic price") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\DynamicPrice")
29-
dynamic_sku: Boolean @doc(description: "Indicates whether the bundle product has a dynamic SK") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\DynamicSku")
30-
ship_bundle_items: ShipBundleItemsEnum @doc(description: "Indicates whether to ship bundle items together or individually") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\ShipBundleItems")
31-
dynamic_weight: Boolean @doc(description: "Indicates whether the bundle product has a dynamically calculated weight") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\DynamicWeight")
32-
items: [BundleItem] @doc(description: "An array containing information about individual bundle items") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\BundleItems")
26+
type BundleProduct implements ProductInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "BundleProduct defines basic features of a bundle product and contains multiple BundleItems.") {
27+
price_view: PriceViewEnum @doc(description: "One of PRICE_RANGE or AS_LOW_AS.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\PriceView")
28+
dynamic_price: Boolean @doc(description: "Indicates whether the bundle product has a dynamic price.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\DynamicPrice")
29+
dynamic_sku: Boolean @doc(description: "Indicates whether the bundle product has a dynamic SK.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\DynamicSku")
30+
ship_bundle_items: ShipBundleItemsEnum @doc(description: "Indicates whether to ship bundle items together or individually.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\ShipBundleItems")
31+
dynamic_weight: Boolean @doc(description: "Indicates whether the bundle product has a dynamically calculated weight.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\DynamicWeight")
32+
items: [BundleItem] @doc(description: "An array containing information about individual bundle items.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\BundleItems")
3333
}
3434

3535
enum PriceViewEnum @doc(description: "This enumeration defines whether a bundle product's price is displayed as the lowest possible value or as a range.") {

app/code/Magento/Catalog/Model/ResourceModel/Product/Option.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Catalog\Model\ResourceModel\Product;
77

88
use Magento\Catalog\Api\Data\ProductInterface;
9+
use Magento\Store\Model\ScopeInterface;
910

1011
/**
1112
* Catalog product custom option resource model
@@ -154,24 +155,26 @@ protected function _saveValuePrices(\Magento\Framework\Model\AbstractModel $obje
154155

155156
$scope = (int)$this->_config->getValue(
156157
\Magento\Store\Model\Store::XML_PATH_PRICE_SCOPE,
157-
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
158+
ScopeInterface::SCOPE_STORE
158159
);
159160

160161
if ($object->getStoreId() != '0' && $scope == \Magento\Store\Model\Store::PRICE_SCOPE_WEBSITE) {
161-
$baseCurrency = $this->_config->getValue(
162+
$website = $this->_storeManager->getStore($object->getStoreId())->getWebsite();
163+
164+
$websiteBaseCurrency = $this->_config->getValue(
162165
\Magento\Directory\Model\Currency::XML_PATH_CURRENCY_BASE,
163-
'default'
166+
ScopeInterface::SCOPE_WEBSITE,
167+
$website
164168
);
165169

166-
$storeIds = $this->_storeManager->getStore($object->getStoreId())->getWebsite()->getStoreIds();
170+
$storeIds = $website->getStoreIds();
167171
if (is_array($storeIds)) {
168172
foreach ($storeIds as $storeId) {
169173
if ($object->getPriceType() == 'fixed') {
170174
$storeCurrency = $this->_storeManager->getStore($storeId)->getBaseCurrencyCode();
171-
$rate = $this->_currencyFactory->create()->load($baseCurrency)->getRate($storeCurrency);
172-
if (!$rate) {
173-
$rate = 1;
174-
}
175+
$rate = $this->_currencyFactory->create()->load($websiteBaseCurrency)
176+
->getRate($storeCurrency);
177+
$rate ?: $rate = 1;
175178
$newPrice = $object->getPrice() * $rate;
176179
} else {
177180
$newPrice = $object->getPrice();
@@ -582,6 +585,8 @@ public function getPriceTypes()
582585
}
583586

584587
/**
588+
* Returns metadata poll.
589+
*
585590
* @return \Magento\Framework\EntityManager\MetadataPool
586591
*/
587592
private function getMetadataPool()

0 commit comments

Comments
 (0)