Skip to content

Commit 615f38e

Browse files
merge magento/2.3-develop into magento-trigger/MAGETWO-99210
2 parents 8674fa4 + 422d513 commit 615f38e

File tree

130 files changed

+4459
-755
lines changed

Some content is hidden

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

130 files changed

+4459
-755
lines changed

app/code/Magento/Braintree/Controller/Paypal/Review.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Magento\Framework\Exception\LocalizedException;
1515
use Magento\Framework\App\Action\HttpPostActionInterface;
1616
use Magento\Framework\App\Action\HttpGetActionInterface;
17+
use Magento\Payment\Model\Method\Logger;
1718

1819
/**
1920
* Class Review
@@ -25,6 +26,11 @@ class Review extends AbstractAction implements HttpPostActionInterface, HttpGetA
2526
*/
2627
private $quoteUpdater;
2728

29+
/**
30+
* @var Logger
31+
*/
32+
private $logger;
33+
2834
/**
2935
* @var string
3036
*/
@@ -37,15 +43,18 @@ class Review extends AbstractAction implements HttpPostActionInterface, HttpGetA
3743
* @param Config $config
3844
* @param Session $checkoutSession
3945
* @param QuoteUpdater $quoteUpdater
46+
* @param Logger $logger
4047
*/
4148
public function __construct(
4249
Context $context,
4350
Config $config,
4451
Session $checkoutSession,
45-
QuoteUpdater $quoteUpdater
52+
QuoteUpdater $quoteUpdater,
53+
Logger $logger
4654
) {
4755
parent::__construct($context, $config, $checkoutSession);
4856
$this->quoteUpdater = $quoteUpdater;
57+
$this->logger = $logger;
4958
}
5059

5160
/**
@@ -57,6 +66,7 @@ public function execute()
5766
$this->getRequest()->getPostValue('result', '{}'),
5867
true
5968
);
69+
$this->logger->debug($requestData);
6070
$quote = $this->checkoutSession->getQuote();
6171

6272
try {

app/code/Magento/Braintree/Model/Paypal/Helper/QuoteUpdater.php

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ private function updateShippingAddress(Quote $quote, array $details)
123123
{
124124
$shippingAddress = $quote->getShippingAddress();
125125

126-
$shippingAddress->setLastname($details['lastName']);
127-
$shippingAddress->setFirstname($details['firstName']);
126+
$shippingAddress->setLastname($this->getShippingRecipientLastName($details));
127+
$shippingAddress->setFirstname($this->getShippingRecipientFirstName($details));
128128
$shippingAddress->setEmail($details['email']);
129129

130130
$shippingAddress->setCollectShippingRates(true);
@@ -188,4 +188,30 @@ private function updateAddressData(Address $address, array $addressData)
188188
$address->setSameAsBilling(false);
189189
$address->setCustomerAddressId(null);
190190
}
191+
192+
/**
193+
* Returns shipping recipient first name.
194+
*
195+
* @param array $details
196+
* @return string
197+
*/
198+
private function getShippingRecipientFirstName(array $details)
199+
{
200+
return isset($details['shippingAddress']['recipientName'])
201+
? explode(' ', $details['shippingAddress']['recipientName'], 2)[0]
202+
: $details['firstName'];
203+
}
204+
205+
/**
206+
* Returns shipping recipient last name.
207+
*
208+
* @param array $details
209+
* @return string
210+
*/
211+
private function getShippingRecipientLastName(array $details)
212+
{
213+
return isset($details['shippingAddress']['recipientName'])
214+
? explode(' ', $details['shippingAddress']['recipientName'], 2)[1]
215+
: $details['lastName'];
216+
}
191217
}

app/code/Magento/Braintree/Test/Unit/Controller/Paypal/ReviewTest.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace Magento\Braintree\Test\Unit\Controller\Paypal;
88

9+
use Magento\Payment\Model\Method\Logger;
910
use Magento\Quote\Model\Quote;
1011
use Magento\Framework\View\Layout;
1112
use Magento\Checkout\Model\Session;
@@ -65,6 +66,11 @@ class ReviewTest extends \PHPUnit\Framework\TestCase
6566
*/
6667
private $review;
6768

69+
/**
70+
* @var Logger|\PHPUnit_Framework_MockObject_MockObject
71+
*/
72+
private $loggerMock;
73+
6874
protected function setUp()
6975
{
7076
/** @var Context|\PHPUnit_Framework_MockObject_MockObject $contextMock */
@@ -88,6 +94,9 @@ protected function setUp()
8894
->getMock();
8995
$this->messageManagerMock = $this->getMockBuilder(ManagerInterface::class)
9096
->getMockForAbstractClass();
97+
$this->loggerMock = $this->getMockBuilder(Logger::class)
98+
->disableOriginalConstructor()
99+
->getMock();
91100

92101
$contextMock->expects(self::once())
93102
->method('getRequest')
@@ -103,7 +112,8 @@ protected function setUp()
103112
$contextMock,
104113
$this->configMock,
105114
$this->checkoutSessionMock,
106-
$this->quoteUpdaterMock
115+
$this->quoteUpdaterMock,
116+
$this->loggerMock
107117
);
108118
}
109119

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ private function getDetails(): array
165165
'region' => 'IL',
166166
'postalCode' => '60618',
167167
'countryCodeAlpha2' => 'US',
168-
'recipientName' => 'John Doe',
168+
'recipientName' => 'Jane Smith',
169169
],
170170
'billingAddress' => [
171171
'streetAddress' => '123 Billing Street',
@@ -186,9 +186,9 @@ private function getDetails(): array
186186
private function updateShippingAddressStep(array $details): void
187187
{
188188
$this->shippingAddress->method('setLastname')
189-
->with($details['lastName']);
189+
->with('Smith');
190190
$this->shippingAddress->method('setFirstname')
191-
->with($details['firstName']);
191+
->with('Jane');
192192
$this->shippingAddress->method('setEmail')
193193
->with($details['email']);
194194
$this->shippingAddress->method('setCollectShippingRates')

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ define([
1010
'Magento_Braintree/js/view/payment/method-renderer/cc-form',
1111
'Magento_Braintree/js/validator',
1212
'Magento_Vault/js/view/payment/vault-enabler',
13-
'mage/translate'
14-
], function ($, Component, validator, VaultEnabler, $t) {
13+
'mage/translate',
14+
'Magento_Checkout/js/model/payment/additional-validators'
15+
], function ($, Component, validator, VaultEnabler, $t, additionalValidators) {
1516
'use strict';
1617

1718
return Component.extend({
@@ -154,7 +155,7 @@ define([
154155
* Trigger order placing
155156
*/
156157
placeOrderClick: function () {
157-
if (this.validateCardType()) {
158+
if (this.validateCardType() && additionalValidators.validate()) {
158159
this.isPlaceOrderActionAllowed(false);
159160
$(this.getSelector('submit')).trigger('click');
160161
}

app/code/Magento/Catalog/Api/Data/CategoryInterface.php

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php
22
/**
3-
* Category data interface
4-
*
53
* Copyright © Magento, Inc. All rights reserved.
64
* See COPYING.txt for license details.
75
*/
86

97
namespace Magento\Catalog\Api\Data;
108

119
/**
10+
* Category data interface.
11+
*
1212
* @api
1313
* @since 100.0.2
1414
*/
@@ -46,11 +46,15 @@ interface CategoryInterface extends \Magento\Framework\Api\CustomAttributesDataI
4646
/**#@-*/
4747

4848
/**
49+
* Retrieve category id.
50+
*
4951
* @return int|null
5052
*/
5153
public function getId();
5254

5355
/**
56+
* Set category id.
57+
*
5458
* @param int $id
5559
* @return $this
5660
*/
@@ -74,7 +78,7 @@ public function setParentId($parentId);
7478
/**
7579
* Get category name
7680
*
77-
* @return string
81+
* @return string|null
7882
*/
7983
public function getName();
8084

@@ -132,60 +136,82 @@ public function getLevel();
132136
public function setLevel($level);
133137

134138
/**
139+
* Retrieve children ids comma separated.
140+
*
135141
* @return string|null
136142
*/
137143
public function getChildren();
138144

139145
/**
146+
* Retrieve category creation date and time.
147+
*
140148
* @return string|null
141149
*/
142150
public function getCreatedAt();
143151

144152
/**
153+
* Set category creation date and time.
154+
*
145155
* @param string $createdAt
146156
* @return $this
147157
*/
148158
public function setCreatedAt($createdAt);
149159

150160
/**
161+
* Retrieve category last update date and time.
162+
*
151163
* @return string|null
152164
*/
153165
public function getUpdatedAt();
154166

155167
/**
168+
* Set category last update date and time.
169+
*
156170
* @param string $updatedAt
157171
* @return $this
158172
*/
159173
public function setUpdatedAt($updatedAt);
160174

161175
/**
176+
* Retrieve category full path.
177+
*
162178
* @return string|null
163179
*/
164180
public function getPath();
165181

166182
/**
183+
* Set category full path.
184+
*
167185
* @param string $path
168186
* @return $this
169187
*/
170188
public function setPath($path);
171189

172190
/**
191+
* Retrieve available sort by for category.
192+
*
173193
* @return string[]|null
174194
*/
175195
public function getAvailableSortBy();
176196

177197
/**
198+
* Set available sort by for category.
199+
*
178200
* @param string[]|string $availableSortBy
179201
* @return $this
180202
*/
181203
public function setAvailableSortBy($availableSortBy);
182204

183205
/**
206+
* Get category is included in menu.
207+
*
184208
* @return bool|null
185209
*/
186210
public function getIncludeInMenu();
187211

188212
/**
213+
* Set category is included in menu.
214+
*
189215
* @param bool $includeInMenu
190216
* @return $this
191217
*/

app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableBuilder.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function build($storeId, $changedIds, $valueFieldSuffix)
115115
/**
116116
* Create empty temporary table with given columns list
117117
*
118-
* @param string $tableName Table name
118+
* @param string $tableName Table name
119119
* @param array $columns array('columnName' => \Magento\Catalog\Model\ResourceModel\Eav\Attribute, ...)
120120
* @param string $valueFieldSuffix
121121
*
@@ -304,12 +304,16 @@ protected function _fillTemporaryTable(
304304

305305
/** @var $attribute \Magento\Catalog\Model\ResourceModel\Eav\Attribute */
306306
foreach ($columnsList as $columnName => $attribute) {
307-
$countTableName = 't' . $iterationNum++;
307+
$countTableName = 't' . ($iterationNum++);
308308
$joinCondition = sprintf(
309-
'e.%3$s = %1$s.%3$s AND %1$s.attribute_id = %2$d AND %1$s.store_id = 0',
309+
'e.%3$s = %1$s.%3$s' .
310+
' AND %1$s.attribute_id = %2$d' .
311+
' AND (%1$s.store_id = %4$d' .
312+
' OR %1$s.store_id = 0)',
310313
$countTableName,
311314
$attribute->getId(),
312-
$metadata->getLinkField()
315+
$metadata->getLinkField(),
316+
$storeId
313317
);
314318

315319
$select->joinLeft(
@@ -323,9 +327,10 @@ protected function _fillTemporaryTable(
323327
$columnValueName = $attributeCode . $valueFieldSuffix;
324328
if (isset($flatColumns[$columnValueName])) {
325329
$valueJoinCondition = sprintf(
326-
'e.%1$s = %2$s.option_id AND %2$s.store_id = 0',
330+
'e.%1$s = %2$s.option_id AND (%2$s.store_id = %3$d OR %2$s.store_id = 0)',
327331
$attributeCode,
328-
$countTableName
332+
$countTableName,
333+
$storeId
329334
);
330335
$selectValue->joinLeft(
331336
[

app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/CategoriesTest.php

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -154,38 +154,4 @@ public function modifyMetaLockedDataProvider()
154154
{
155155
return [[true], [false]];
156156
}
157-
158-
public function testModifyMetaWithCaching()
159-
{
160-
$this->arrayManagerMock->expects($this->exactly(2))
161-
->method('findPath')
162-
->willReturn(true);
163-
$cacheManager = $this->getMockBuilder(CacheInterface::class)
164-
->getMockForAbstractClass();
165-
$cacheManager->expects($this->once())
166-
->method('load')
167-
->with(Categories::CATEGORY_TREE_ID . '_');
168-
$cacheManager->expects($this->once())
169-
->method('save');
170-
171-
$modifier = $this->createModel();
172-
$cacheContextProperty = new \ReflectionProperty(
173-
Categories::class,
174-
'cacheManager'
175-
);
176-
$cacheContextProperty->setAccessible(true);
177-
$cacheContextProperty->setValue($modifier, $cacheManager);
178-
179-
$groupCode = 'test_group_code';
180-
$meta = [
181-
$groupCode => [
182-
'children' => [
183-
'category_ids' => [
184-
'sortOrder' => 10,
185-
],
186-
],
187-
],
188-
];
189-
$modifier->modifyMeta($meta);
190-
}
191157
}

0 commit comments

Comments
 (0)