Skip to content

Commit 4543354

Browse files
Merge pull request magento#4249 from magento-engcom/2.3-develop-prs
[Magento Community Engineering] Community Contributions - 2.3-develop
2 parents 7120c6e + e2124e2 commit 4543354

File tree

17 files changed

+199
-130
lines changed

17 files changed

+199
-130
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/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()

app/code/Magento/CatalogInventory/Helper/Minsaleqty.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ protected function serializeValue($value)
9595
}
9696
return $this->serializer->serialize($data);
9797
} else {
98-
return '';
98+
return $value;
9999
}
100100
}
101101

app/code/Magento/CatalogInventory/Test/Unit/Helper/MinsaleqtyTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public function testMakeStorableArrayFieldValue($value, $result, $serializeCallC
216216
public function makeStorableArrayFieldValueDataProvider()
217217
{
218218
return [
219-
'invalid bool' => [false, ''],
219+
'invalid bool' => [false, false],
220220
'invalid empty string' => ['', ''],
221221
'valid numeric' => ['22', '22'],
222222
'valid empty array' => [[], '[]', 1],
@@ -240,7 +240,8 @@ public function makeStorableArrayFieldValueDataProvider()
240240
'[1]',
241241
1,
242242
[0 => 1.0]
243-
]
243+
],
244+
'json value' => ['{"32000":2,"0":1}', '{"32000":2,"0":1}'],
244245
];
245246
}
246247
}

app/code/Magento/Customer/Model/ResourceModel/CustomerRepository.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@ public function save(CustomerInterface $customer, $passwordHash = null)
209209
$customerModel->setId($customer->getId());
210210
$storeId = $customerModel->getStoreId();
211211
if ($storeId === null) {
212-
$customerModel->setStoreId($this->storeManager->getStore()->getId());
212+
$customerModel->setStoreId(
213+
$prevCustomerData ? $prevCustomerData->getStoreId() : $this->storeManager->getStore()->getId()
214+
);
213215
}
214216
// Need to use attribute set or future updates can cause data loss
215217
if (!$customerModel->getAttributeSetId()) {
@@ -277,7 +279,6 @@ public function save(CustomerInterface $customer, $passwordHash = null)
277279
'delegate_data' => $delegatedNewOperation ? $delegatedNewOperation->getAdditionalData() : [],
278280
]
279281
);
280-
281282
return $savedCustomer;
282283
}
283284

app/code/Magento/Customer/Test/Unit/Model/ResourceModel/CustomerRepositoryTest.php

Lines changed: 52 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ protected function setUp()
107107
$this->createMock(\Magento\Customer\Model\ResourceModel\Customer::class);
108108
$this->customerRegistry = $this->createMock(\Magento\Customer\Model\CustomerRegistry::class);
109109
$this->dataObjectHelper = $this->createMock(\Magento\Framework\Api\DataObjectHelper::class);
110-
$this->customerFactory =
110+
$this->customerFactory =
111111
$this->createPartialMock(\Magento\Customer\Model\CustomerFactory::class, ['create']);
112112
$this->customerSecureFactory = $this->createPartialMock(
113113
\Magento\Customer\Model\Data\CustomerSecureFactory::class,
@@ -193,9 +193,10 @@ protected function setUp()
193193
public function testSave()
194194
{
195195
$customerId = 1;
196-
$storeId = 2;
197196

198-
$customerModel = $this->createPartialMock(\Magento\Customer\Model\Customer::class, [
197+
$customerModel = $this->createPartialMock(
198+
\Magento\Customer\Model\Customer::class,
199+
[
199200
'getId',
200201
'setId',
201202
'setStoreId',
@@ -210,7 +211,8 @@ public function testSave()
210211
'setFirstFailure',
211212
'setLockExpires',
212213
'save',
213-
]);
214+
]
215+
);
214216

215217
$origCustomer = $this->customer;
216218

@@ -229,14 +231,17 @@ public function testSave()
229231
'setAddresses'
230232
]
231233
);
232-
$customerSecureData = $this->createPartialMock(\Magento\Customer\Model\Data\CustomerSecure::class, [
233-
'getRpToken',
234-
'getRpTokenCreatedAt',
235-
'getPasswordHash',
236-
'getFailuresNum',
237-
'getFirstFailure',
238-
'getLockExpires',
239-
]);
234+
$customerSecureData = $this->createPartialMock(
235+
\Magento\Customer\Model\Data\CustomerSecure::class,
236+
[
237+
'getRpToken',
238+
'getRpTokenCreatedAt',
239+
'getPasswordHash',
240+
'getFailuresNum',
241+
'getFirstFailure',
242+
'getLockExpires',
243+
]
244+
);
240245
$this->customer->expects($this->atLeastOnce())
241246
->method('getId')
242247
->willReturn($customerId);
@@ -268,17 +273,6 @@ public function testSave()
268273
$customerModel->expects($this->once())
269274
->method('getStoreId')
270275
->willReturn(null);
271-
$store = $this->createMock(\Magento\Store\Model\Store::class);
272-
$store->expects($this->once())
273-
->method('getId')
274-
->willReturn($storeId);
275-
$this->storeManager
276-
->expects($this->once())
277-
->method('getStore')
278-
->willReturn($store);
279-
$customerModel->expects($this->once())
280-
->method('setStoreId')
281-
->with($storeId);
282276
$customerModel->expects($this->once())
283277
->method('setId')
284278
->with($customerId);
@@ -310,16 +304,20 @@ public function testSave()
310304

311305
$customerModel->expects($this->once())
312306
->method('setRpToken')
313-
->willReturnMap([
307+
->willReturnMap(
308+
[
314309
['rpToken', $customerModel],
315310
[null, $customerModel],
316-
]);
311+
]
312+
);
317313
$customerModel->expects($this->once())
318314
->method('setRpTokenCreatedAt')
319-
->willReturnMap([
315+
->willReturnMap(
316+
[
320317
['rpTokenCreatedAt', $customerModel],
321318
[null, $customerModel],
322-
]);
319+
]
320+
);
323321

324322
$customerModel->expects($this->once())
325323
->method('setPasswordHash')
@@ -371,32 +369,37 @@ public function testSave()
371369
public function testSaveWithPasswordHash()
372370
{
373371
$customerId = 1;
374-
$storeId = 2;
375372
$passwordHash = 'ukfa4sdfa56s5df02asdf4rt';
376373

377-
$customerSecureData = $this->createPartialMock(\Magento\Customer\Model\Data\CustomerSecure::class, [
378-
'getRpToken',
379-
'getRpTokenCreatedAt',
380-
'getPasswordHash',
381-
'getFailuresNum',
382-
'getFirstFailure',
383-
'getLockExpires',
384-
]);
374+
$customerSecureData = $this->createPartialMock(
375+
\Magento\Customer\Model\Data\CustomerSecure::class,
376+
[
377+
'getRpToken',
378+
'getRpTokenCreatedAt',
379+
'getPasswordHash',
380+
'getFailuresNum',
381+
'getFirstFailure',
382+
'getLockExpires',
383+
]
384+
);
385385
$origCustomer = $this->customer;
386386

387-
$customerModel = $this->createPartialMock(\Magento\Customer\Model\Customer::class, [
388-
'getId',
389-
'setId',
390-
'setStoreId',
391-
'getStoreId',
392-
'getAttributeSetId',
393-
'setAttributeSetId',
394-
'setRpToken',
395-
'setRpTokenCreatedAt',
396-
'getDataModel',
397-
'setPasswordHash',
398-
'save',
399-
]);
387+
$customerModel = $this->createPartialMock(
388+
\Magento\Customer\Model\Customer::class,
389+
[
390+
'getId',
391+
'setId',
392+
'setStoreId',
393+
'getStoreId',
394+
'getAttributeSetId',
395+
'setAttributeSetId',
396+
'setRpToken',
397+
'setRpTokenCreatedAt',
398+
'getDataModel',
399+
'setPasswordHash',
400+
'save',
401+
]
402+
);
400403
$customerAttributesMetaData = $this->getMockForAbstractClass(
401404
\Magento\Framework\Api\CustomAttributesDataInterface::class,
402405
[],
@@ -447,7 +450,6 @@ public function testSaveWithPasswordHash()
447450
$customerSecureData->expects($this->once())
448451
->method('getLockExpires')
449452
->willReturn('lockExpires');
450-
451453
$this->customer->expects($this->atLeastOnce())
452454
->method('getId')
453455
->willReturn($customerId);
@@ -477,20 +479,6 @@ public function testSaveWithPasswordHash()
477479
->method('create')
478480
->with(['data' => ['customerData']])
479481
->willReturn($customerModel);
480-
$customerModel->expects($this->once())
481-
->method('getStoreId')
482-
->willReturn(null);
483-
$store = $this->createMock(\Magento\Store\Model\Store::class);
484-
$store->expects($this->once())
485-
->method('getId')
486-
->willReturn($storeId);
487-
$this->storeManager
488-
->expects($this->once())
489-
->method('getStore')
490-
->willReturn($store);
491-
$customerModel->expects($this->once())
492-
->method('setStoreId')
493-
->with($storeId);
494482
$customerModel->expects($this->once())
495483
->method('setId')
496484
->with($customerId);

app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/header/actions-group/_search.less

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@
8686
position: absolute;
8787
right: 0;
8888
top: 100%;
89+
word-break: break-word;
90+
word-wrap: break-word;
8991
z-index: 2;
9092

9193
&:after {

app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/actions-bar/_store-switcher.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
.store-view {
236236
&:not(.store-switcher) {
237237
float: left;
238-
margin-top: 13px;
238+
margin-top: 1.10rem;
239239
}
240240

241241
.store-switcher-label {

0 commit comments

Comments
 (0)