Skip to content

Commit ab54291

Browse files
author
Dmytro Yushkin
committed
Merge branch 'develop' of github.com:magento/magento2ce into bugfixes
2 parents 02080ab + d758023 commit ab54291

File tree

131 files changed

+5534
-1029
lines changed

Some content is hidden

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

131 files changed

+5534
-1029
lines changed

app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,20 @@
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<body>
1010
<referenceContainer name="notifications">
11-
<block class="Magento\AdminNotification\Block\System\Messages" name="system_messages" as="system_messages" before="-" template="Magento_AdminNotification::system/messages.phtml"/>
12-
<block class="Magento\AdminNotification\Block\System\Messages\UnreadMessagePopup" name="unread_system_messages" as="unread_system_messages" after="system_messages" template="Magento_AdminNotification::system/messages/popup.phtml"/>
13-
<block class="Magento\AdminNotification\Block\Window" name="notification_window" as="notification_window" acl="Magento_AdminNotification::show_toolbar" template="notification/window.phtml"/>
11+
<block class="Magento\AdminNotification\Block\System\Messages"
12+
name="system_messages"
13+
as="system_messages"
14+
before="-"
15+
template="Magento_AdminNotification::system/messages.phtml"/>
16+
<block class="Magento\AdminNotification\Block\System\Messages\UnreadMessagePopup"
17+
name="unread_system_messages"
18+
as="unread_system_messages"
19+
template="Magento_AdminNotification::system/messages/popup.phtml"/>
20+
<block class="Magento\AdminNotification\Block\Window"
21+
name="notification_window"
22+
as="notification_window"
23+
acl="Magento_AdminNotification::show_toolbar"
24+
template="notification/window.phtml"/>
1425
</referenceContainer>
1526
<referenceContainer name="header">
1627
<block class="Magento\AdminNotification\Block\ToolbarEntry" name="notification.messages" before="user" template="toolbar_entry.phtml"/>

app/code/Magento/Backend/Block/Page/System/Config/Robots/Reset.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
/**
1414
* "Reset to Defaults" button renderer
1515
*
16+
* @deprecated
1617
* @author Magento Core Team <core@magentocommerce.com>
1718
*/
1819
class Reset extends \Magento\Config\Block\System\Config\Form\Field

app/code/Magento/Backend/Test/Unit/Block/Page/System/Config/Robots/ResetTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
*/
1010
namespace Magento\Backend\Test\Unit\Block\Page\System\Config\Robots;
1111

12+
/**
13+
* Class ResetTest
14+
* @deprecated
15+
* @package Magento\Backend\Test\Unit\Block\Page\System\Config\Robots
16+
*/
1217
class ResetTest extends \PHPUnit_Framework_TestCase
1318
{
1419
/**

app/code/Magento/Braintree/view/adminhtml/layout/sales_order_create_index.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
<argument name="template" xsi:type="string">Magento_Vault::form/vault.phtml</argument>
2020
</action>
2121
</referenceBlock>
22-
<referenceBlock name="content">
22+
<referenceBlock name="data">
2323
<block name="braintree_payment_script"
2424
as="braintree_payment_script"
25-
after="billing_method"
2625
template="Magento_Braintree::payment/script.phtml"
27-
class="Magento\Braintree\Block\Payment"/>
26+
class="Magento\Braintree\Block\Payment"
27+
after="billing_method"/>
2828
</referenceBlock>
2929
</body>
3030
</page>

app/code/Magento/Bundle/Pricing/Price/BundleSelectionPrice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function getValue()
124124
$value = $product->getData('final_price') * ($selectionPriceValue / 100);
125125
} else {
126126
// calculate price for selection type fixed
127-
$value = $this->priceCurrency->convert($selectionPriceValue) * $this->quantity;
127+
$value = $this->priceCurrency->convert($selectionPriceValue);
128128
}
129129
}
130130
if (!$this->useRegularPrice) {

app/code/Magento/Bundle/Test/Unit/Pricing/Price/BundleSelectionPriceTest.php

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,67 @@ public function testGetValueTypeFixedWithoutSelectionPriceType($useRegularPrice)
313313
$this->assertEquals($expectedPrice, $this->selectionPrice->getValue());
314314
}
315315

316+
/**
317+
* test for method getValue with type Fixed and selectionPriceType is empty or zero
318+
*
319+
* @param bool $useRegularPrice
320+
* @dataProvider useRegularPriceDataProvider
321+
*/
322+
public function testFixedPriceWithMultipleQty($useRegularPrice)
323+
{
324+
$qty = 2;
325+
326+
$selectionPrice = new \Magento\Bundle\Pricing\Price\BundleSelectionPrice(
327+
$this->productMock,
328+
$qty,
329+
$this->calculatorMock,
330+
$this->priceCurrencyMock,
331+
$this->bundleMock,
332+
$this->eventManagerMock,
333+
$this->discountCalculatorMock,
334+
$useRegularPrice
335+
);
336+
337+
$this->setupSelectionPrice($useRegularPrice);
338+
$regularPrice = 100.125;
339+
$discountedPrice = 70.453;
340+
$convertedValue = 100.247;
341+
$actualPrice = $useRegularPrice ? $convertedValue : $discountedPrice;
342+
$expectedPrice = $useRegularPrice ? round($convertedValue, 2) : round($discountedPrice, 2);
343+
344+
$this->bundleMock->expects($this->once())
345+
->method('getPriceType')
346+
->will($this->returnValue(\Magento\Bundle\Model\Product\Price::PRICE_TYPE_FIXED));
347+
$this->productMock->expects($this->once())
348+
->method('getSelectionPriceType')
349+
->will($this->returnValue(false));
350+
$this->productMock->expects($this->any())
351+
->method('getSelectionPriceValue')
352+
->will($this->returnValue($regularPrice));
353+
354+
$this->priceCurrencyMock->expects($this->once())
355+
->method('convert')
356+
->with($regularPrice)
357+
->will($this->returnValue($convertedValue));
358+
359+
if (!$useRegularPrice) {
360+
$this->discountCalculatorMock->expects($this->once())
361+
->method('calculateDiscount')
362+
->with(
363+
$this->equalTo($this->bundleMock),
364+
$this->equalTo($convertedValue)
365+
)
366+
->will($this->returnValue($discountedPrice));
367+
}
368+
369+
$this->priceCurrencyMock->expects($this->once())
370+
->method('round')
371+
->with($actualPrice)
372+
->will($this->returnValue($expectedPrice));
373+
374+
$this->assertEquals($expectedPrice, $selectionPrice->getValue());
375+
}
376+
316377
public function useRegularPriceDataProvider()
317378
{
318379
return [

app/code/Magento/Bundle/view/base/web/js/price-bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ define([
5555
this._setOption('priceFormat', priceBox.priceBox('option').priceConfig.priceFormat);
5656
priceBox.priceBox('setDefault', this.options.optionConfig.prices);
5757
}
58-
this._applyQtyFix();
5958
this._applyOptionNodeFix(options);
6059

6160
options.on('change', this._onBundleOptionChanged.bind(this));
@@ -113,6 +112,7 @@ define([
113112
* Helper to fix backend behavior:
114113
* - if default qty large than 1 then backend multiply price in config
115114
*
115+
* @deprecated
116116
* @private
117117
*/
118118
_applyQtyFix: function applyQtyFix() {

app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_bundle.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
</block>
3737
</referenceBlock>
3838
<referenceBlock name="product.info.form.options">
39-
<container name="bundle.product.options.wrapper" htmlTag="div" htmlClass="bundle-options-wrapper" after="product.info.form.options" />
39+
<container name="bundle.product.options.wrapper" htmlTag="div" htmlClass="bundle-options-wrapper"/>
4040
</referenceBlock>
4141
<move element="product.info.options.wrapper" destination="bundle.product.options.wrapper" before="-" />
4242
<move element="product.info.options.wrapper.bottom" destination="bundle.product.options.wrapper" after="product.info.options.wrapper" />

app/code/Magento/Catalog/Pricing/Price/TierPrice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ protected function getBasePrice()
208208
*/
209209
public function getSavePercent(AmountInterface $amount)
210210
{
211-
return ceil(
211+
return round(
212212
100 - ((100 / $this->priceInfo->getPrice(FinalPrice::PRICE_CODE)->getValue())
213213
* $amount->getBaseAmount())
214214
);

app/code/Magento/Catalog/Setup/CategorySetup.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ class CategorySetup extends EavSetup
2424
*/
2525
private $categoryFactory;
2626

27+
/**
28+
* This should be set explicitly
29+
*/
30+
const CATEGORY_ENTITY_TYPE_ID = 3;
31+
32+
/**
33+
* This should be set explicitly
34+
*/
35+
const CATALOG_PRODUCT_ENTITY_TYPE_ID = 4;
36+
2737
/**
2838
* Init
2939
*
@@ -66,6 +76,7 @@ public function getDefaultEntities()
6676
{
6777
return [
6878
'catalog_category' => [
79+
'entity_type_id' => self::CATEGORY_ENTITY_TYPE_ID,
6980
'entity_model' => 'Magento\Catalog\Model\ResourceModel\Category',
7081
'attribute_model' => 'Magento\Catalog\Model\ResourceModel\Eav\Attribute',
7182
'table' => 'catalog_category_entity',
@@ -334,6 +345,7 @@ public function getDefaultEntities()
334345
],
335346
],
336347
'catalog_product' => [
348+
'entity_type_id' => self::CATALOG_PRODUCT_ENTITY_TYPE_ID,
337349
'entity_model' => 'Magento\Catalog\Model\ResourceModel\Product',
338350
'attribute_model' => 'Magento\Catalog\Model\ResourceModel\Eav\Attribute',
339351
'table' => 'catalog_product_entity',

0 commit comments

Comments
 (0)