Skip to content

Commit fe4227c

Browse files
author
Joan He
committed
Merge remote-tracking branch 'upstream/develop' into pr
2 parents 767fad7 + 58edd7f commit fe4227c

File tree

332 files changed

+4559
-3985
lines changed

Some content is hidden

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

332 files changed

+4559
-3985
lines changed

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@
1616
<argument name="storage" xsi:type="object">Magento\Authorizenet\Model\Directpost\Session\Storage</argument>
1717
</arguments>
1818
</type>
19-
<type name="Magento\Config\Model\Config\Export\ExcludeList">
20-
<arguments>
21-
<argument name="configs" xsi:type="array">
22-
<item name="payment/authorizenet_directpost/login" xsi:type="string">1</item>
23-
<item name="payment/authorizenet_directpost/trans_key" xsi:type="string">1</item>
24-
<item name="payment/authorizenet_directpost/trans_md5" xsi:type="string">1</item>
25-
<item name="payment/authorizenet_directpost/merchant_email" xsi:type="string">1</item>
26-
</argument>
27-
</arguments>
28-
</type>
2919
<type name="Magento\Config\Model\Config\TypePool">
3020
<arguments>
3121
<argument name="sensitive" xsi:type="array">

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

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -171,24 +171,6 @@
171171
</argument>
172172
</arguments>
173173
</type>
174-
<type name="Magento\Config\Model\Config\Export\ExcludeList">
175-
<arguments>
176-
<argument name="configs" xsi:type="array">
177-
<item name="trans_email/ident_general/name" xsi:type="string">1</item>
178-
<item name="trans_email/ident_general/email" xsi:type="string">1</item>
179-
<item name="trans_email/ident_sales/name" xsi:type="string">1</item>
180-
<item name="trans_email/ident_sales/email" xsi:type="string">1</item>
181-
<item name="trans_email/ident_support/name" xsi:type="string">1</item>
182-
<item name="trans_email/ident_support/email" xsi:type="string">1</item>
183-
<item name="trans_email/ident_custom1/name" xsi:type="string">1</item>
184-
<item name="trans_email/ident_custom1/email" xsi:type="string">1</item>
185-
<item name="trans_email/ident_custom2/name" xsi:type="string">1</item>
186-
<item name="trans_email/ident_custom2/email" xsi:type="string">1</item>
187-
<item name="admin/url/custom" xsi:type="string">1</item>
188-
<item name="admin/url/custom_path" xsi:type="string">1</item>
189-
</argument>
190-
</arguments>
191-
</type>
192174
<type name="Magento\Config\Model\Config\TypePool">
193175
<arguments>
194176
<argument name="sensitive" xsi:type="array">

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,5 +182,10 @@ private function updateAddressData(Address $address, array $addressData)
182182
$address->setRegionCode($addressData['region']);
183183
$address->setCountryId($addressData['countryCodeAlpha2']);
184184
$address->setPostcode($addressData['postalCode']);
185+
186+
// PayPal's address supposes not saving against customer account
187+
$address->setSaveInAddressBook(false);
188+
$address->setSameAsBilling(false);
189+
$address->setCustomerAddressId(null);
185190
}
186191
}

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -544,18 +544,6 @@
544544
</arguments>
545545
</type>
546546
<!-- END Settlement Report Section -->
547-
<type name="Magento\Config\Model\Config\Export\ExcludeList">
548-
<arguments>
549-
<argument name="configs" xsi:type="array">
550-
<item name="payment/braintree/merchant_id" xsi:type="string">1</item>
551-
<item name="payment/braintree/public_key" xsi:type="string">1</item>
552-
<item name="payment/braintree/private_key" xsi:type="string">1</item>
553-
<item name="payment/braintree/merchant_account_id" xsi:type="string">1</item>
554-
<item name="payment/braintree/kount_id" xsi:type="string">1</item>
555-
<item name="payment/braintree_paypal/merchant_name_override" xsi:type="string">1</item>
556-
</argument>
557-
</arguments>
558-
</type>
559547
<type name="Magento\Config\Model\Config\TypePool">
560548
<arguments>
561549
<argument name="sensitive" xsi:type="array">

app/code/Magento/Bundle/Pricing/Adjustment/Calculator.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,11 @@ protected function calculateDynamicBundleAmount($basePriceValue, $bundleProduct,
316316

317317
foreach ($selectionPriceList as $selectionPrice) {
318318
++$i;
319-
$amountList[$i]['amount'] = $selectionPrice->getAmount();
320-
// always honor the quantity given
321-
$amountList[$i]['quantity'] = $selectionPrice->getQuantity();
319+
if ($selectionPrice) {
320+
$amountList[$i]['amount'] = $selectionPrice->getAmount();
321+
// always honor the quantity given
322+
$amountList[$i]['quantity'] = $selectionPrice->getQuantity();
323+
}
322324
}
323325

324326
/** @var Store $store */

app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ public function getDuplicateUrl()
249249
}
250250

251251
/**
252+
* @deprecated
252253
* @return string
253254
*/
254255
public function getHeader()

app/code/Magento/Catalog/Block/Product/ListProduct.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,15 @@ public function getProductPrice(\Magento\Catalog\Model\Product $product)
317317
}
318318

319319
/**
320+
* Specifies that price rendering should be done for the list of products
321+
* i.e. rendering happens in the scope of product list, but not single product
322+
*
320323
* @return \Magento\Framework\Pricing\Render
321324
*/
322325
protected function getPriceRender()
323326
{
324-
return $this->getLayout()->getBlock('product.price.render.default');
327+
return $this->getLayout()->getBlock('product.price.render.default')
328+
->setData('is_product_list', true);
325329
}
326330

327331
/**

app/code/Magento/Catalog/Model/ResourceModel/Category.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,10 @@ public function getIsActiveAttributeId()
583583
*/
584584
public function findWhereAttributeIs($entityIdsFilter, $attribute, $expectedValue)
585585
{
586+
// @codingStandardsIgnoreStart
586587
$serializeData = $this->serializer->serialize($entityIdsFilter);
587588
$entityIdsFilterHash = md5($serializeData);
589+
// @codingStandardsIgnoreEnd
588590

589591
if (!isset($this->entitiesWhereAttributesIs[$entityIdsFilterHash][$attribute->getId()][$expectedValue])) {
590592
$linkField = $this->getLinkField();
@@ -767,7 +769,6 @@ public function getChildren($category, $recursive = true)
767769
$backendTable = $this->getTable([$this->getEntityTablePrefix(), 'int']);
768770
$connection = $this->getConnection();
769771
$checkSql = $connection->getCheckSql('c.value_id > 0', 'c.value', 'd.value');
770-
$linkField = $this->getLinkField();
771772
$bind = [
772773
'attribute_id' => $attributeId,
773774
'store_id' => $category->getStoreId(),

app/code/Magento/Catalog/Pricing/Render/FinalPriceBox.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,19 @@ public function getCacheKeyInfo()
193193
{
194194
$cacheKeys = parent::getCacheKeyInfo();
195195
$cacheKeys['display_minimal_price'] = $this->getDisplayMinimalPrice();
196+
$cacheKeys['is_product_list'] = $this->isProductList();
196197
return $cacheKeys;
197198
}
199+
200+
/**
201+
* Get flag that price rendering should be done for the list of products
202+
* By default (if flag is not set) is false
203+
*
204+
* @return bool
205+
*/
206+
public function isProductList()
207+
{
208+
$isProductList = $this->getData('is_product_list');
209+
return $isProductList === true;
210+
}
198211
}

app/code/Magento/Catalog/Test/Unit/Block/Product/ListProductTest.php

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
*/
66
namespace Magento\Catalog\Test\Unit\Block\Product;
77

8+
use Magento\Catalog\Block\Product\Context;
9+
use Magento\Framework\Event\ManagerInterface;
10+
use Magento\Framework\Pricing\Render;
11+
use Magento\Framework\Url\Helper\Data;
12+
use Magento\Framework\View\LayoutInterface;
13+
814
/**
915
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1016
*/
@@ -46,7 +52,7 @@ class ListProductTest extends \PHPUnit_Framework_TestCase
4652
protected $typeInstanceMock;
4753

4854
/**
49-
* @var \Magento\Framework\Url\Helper\Data | \PHPUnit_Framework_MockObject_MockObject
55+
* @var Data | \PHPUnit_Framework_MockObject_MockObject
5056
*/
5157
protected $urlHelperMock;
5258

@@ -70,6 +76,16 @@ class ListProductTest extends \PHPUnit_Framework_TestCase
7076
*/
7177
protected $toolbarMock;
7278

79+
/**
80+
* @var Context|\PHPUnit_Framework_MockObject_MockObject
81+
*/
82+
private $context;
83+
84+
/**
85+
* @var Render|\PHPUnit_Framework_MockObject_MockObject
86+
*/
87+
private $renderer;
88+
7389
protected function setUp()
7490
{
7591
$objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
@@ -141,20 +157,28 @@ protected function setUp()
141157
false
142158
);
143159

144-
$this->urlHelperMock = $this->getMockBuilder(\Magento\Framework\Url\Helper\Data::class)
145-
->disableOriginalConstructor()->getMock();
160+
$this->urlHelperMock = $this->getMockBuilder(Data::class)->disableOriginalConstructor()->getMock();
161+
$this->context = $this->getMockBuilder(Context::class)->disableOriginalConstructor()->getMock();
162+
$this->renderer = $this->getMockBuilder(Render::class)->disableOriginalConstructor()->getMock();
163+
$eventManager = $this->getMockForAbstractClass(ManagerInterface::class, [], '', false);
164+
165+
$this->context->expects($this->any())->method('getRegistry')->willReturn($this->registryMock);
166+
$this->context->expects($this->any())->method('getCartHelper')->willReturn($this->cartHelperMock);
167+
$this->context->expects($this->any())->method('getLayout')->willReturn($this->layoutMock);
168+
$this->context->expects($this->any())->method('getEventManager')->willReturn($eventManager);
169+
146170
$this->block = $objectManager->getObject(
147171
\Magento\Catalog\Block\Product\ListProduct::class,
148172
[
149173
'registry' => $this->registryMock,
174+
'context' => $this->context,
150175
'layerResolver' => $layerResolver,
151176
'cartHelper' => $this->cartHelperMock,
152177
'postDataHelper' => $this->postDataHelperMock,
153178
'urlHelper' => $this->urlHelperMock,
154179
]
155180
);
156181
$this->block->setToolbarBlockName('mock');
157-
$this->block->setLayout($this->layoutMock);
158182
}
159183

160184
protected function tearDown()
@@ -257,4 +281,18 @@ public function testGetAddToCartPostParams()
257281
$result = $this->block->getAddToCartPostParams($this->productMock);
258282
$this->assertEquals($expectedPostData, $result);
259283
}
284+
285+
public function testSetIsProductListFlagOnGetProductPrice()
286+
{
287+
$this->renderer->expects($this->once())
288+
->method('setData')
289+
->with('is_product_list', true)
290+
->willReturnSelf();
291+
$this->layoutMock->expects($this->once())
292+
->method('getBlock')
293+
->with('product.price.render.default')
294+
->willReturn($this->renderer);
295+
296+
$this->block->getProductPrice($this->productMock);
297+
}
260298
}

0 commit comments

Comments
 (0)