Skip to content

Commit f5ff78e

Browse files
author
Ivan Gavryshko
committed
Merge remote-tracking branch 'mainline/develop' into MAGETWO-51927-setup-cron-out-of-memory-issue
2 parents fbd1d7d + efc35bb commit f5ff78e

File tree

94 files changed

+1594
-598
lines changed

Some content is hidden

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

94 files changed

+1594
-598
lines changed

app/code/Magento/AdminNotification/view/adminhtml/templates/notification/window.phtml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,18 @@
1212
* @see \Magento\AdminNotification\Block\Window
1313
*/
1414
?>
15-
<div data-mage-init='{"modalPopup": {}}' class="fade critical-notification">
16-
<div class="popup popup-<?php /* @escapeNotVerified */ echo preg_replace('#[^a-z0-9]+#', '-', strtolower($block->getSeverityText())) ?>">
17-
<div class="popup-inner">
18-
<div class="popup-header">
19-
<div class="popup-title"><?php /* @escapeNotVerified */ echo $block->getHeaderText(); ?></div>
20-
</div>
21-
<div class="popup-content">
22-
<span><?php /* @escapeNotVerified */ echo $block->getSeverityText();?></span>
23-
24-
<p class="message-text"><?php /* @escapeNotVerified */ echo $block->getNoticeMessageText(); ?></p>
25-
26-
<a href="<?php /* @escapeNotVerified */ echo $block->getNoticeMessageUrl(); ?>"><?php /* @escapeNotVerified */ echo $block->getReadDetailsText(); ?></a>
27-
</div>
28-
<span class="action close" data-dismiss="popup" title="<?php echo $block->escapeHtml(__('Close popup'));?>"><?php /* @escapeNotVerified */ echo __('Close'); ?></span>
29-
</div>
30-
</div>
31-
</div>
15+
<ul class="message-system-list"
16+
style="display: none;"
17+
data-mage-init='{
18+
"Magento_Ui/js/modal/modal": {
19+
"autoOpen": true,
20+
"buttons": false,
21+
"modalClass": "modal-system-messages",
22+
"title": "<?php /* @escapeNotVerified */ echo $block->getHeaderText(); ?>"
23+
}
24+
}'>
25+
<li class="message message-warning warning">
26+
<?php /* @escapeNotVerified */ echo $block->getNoticeMessageText(); ?><br/>
27+
<a href="<?php /* @escapeNotVerified */ echo $block->getNoticeMessageUrl(); ?>"><?php /* @escapeNotVerified */ echo $block->getReadDetailsText(); ?></a>
28+
</li>
29+
</ul>

app/code/Magento/Backend/view/adminhtml/web/template/dynamic-rows/grid.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<table class="admin__dynamic-rows data-grid" data-role="grid">
4747
<thead if="element.columnsHeader">
4848
<tr>
49-
<th if="dndConfig.enabled"
49+
<th if="$data.dndConfig.enabled"
5050
class="data-grid-draggable-row-cell"/>
5151

5252
<th repeat="foreach: labels, item: '$label'"
@@ -67,7 +67,7 @@
6767
class="data-grid-draggable-row-cell"
6868
template="name: dndConfig.template, data: dnd"/>
6969

70-
<!-- ko fastForEach: { data: $record().elems, as: 'elem'} -->
70+
<!-- ko foreach: { data: $record().elems(), as: 'elem'} -->
7171
<td if="elem.template"
7272
visible="elem.visible"
7373
disable="elem.disabled"

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,20 @@ public function __construct(
4343
}
4444

4545
/**
46-
* Get Price Amount object
47-
*
48-
* @return AmountInterface
46+
* @inheritdoc
4947
*/
5048
public function getAmount()
5149
{
52-
if (null === $this->amount) {
50+
if (!isset($this->amount[$this->getValue()])) {
5351
$price = $this->getValue();
5452
if ($this->product->getPriceType() == Price::PRICE_TYPE_FIXED) {
5553
/** @var \Magento\Catalog\Pricing\Price\CustomOptionPrice $customOptionPrice */
5654
$customOptionPrice = $this->priceInfo->getPrice(CustomOptionPrice::PRICE_CODE);
5755
$price += $customOptionPrice->getCustomOptionRange(true);
5856
}
59-
$this->amount = $this->calculator->getMinRegularAmount($price, $this->product);
57+
$this->amount[$this->getValue()] = $this->calculator->getMinRegularAmount($price, $this->product);
6058
}
61-
return $this->amount;
59+
return $this->amount[$this->getValue()];
6260
}
6361

6462
/**

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,18 @@ public function getValue()
142142
*/
143143
public function getAmount()
144144
{
145-
if (null === $this->amount) {
145+
if (!isset($this->amount[$this->getValue()])) {
146146
$exclude = null;
147147
if ($this->getProduct()->getTypeId() == \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) {
148148
$exclude = $this->excludeAdjustment;
149149
}
150-
$this->amount = $this->calculator->getAmount($this->getValue(), $this->getProduct(), $exclude);
150+
$this->amount[$this->getValue()] = $this->calculator->getAmount(
151+
$this->getValue(),
152+
$this->getProduct(),
153+
$exclude
154+
);
151155
}
152-
return $this->amount;
156+
return $this->amount[$this->getValue()];
153157
}
154158

155159
/**

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

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,8 @@ protected function setUp()
9191
'',
9292
false
9393
);
94-
$this->calculatorMock = $this->getMock(
95-
'Magento\Framework\Pricing\Adjustment\CalculatorInterface',
96-
[],
97-
[],
98-
'',
99-
false,
100-
true,
101-
false
102-
);
94+
$this->calculatorMock = $this->getMockBuilder('Magento\Framework\Pricing\Adjustment\CalculatorInterface')
95+
->getMockForAbstractClass();
10396
$this->eventManagerMock = $this->getMock(
10497
'Magento\Framework\Event\Manager',
10598
['dispatch'],
@@ -349,4 +342,42 @@ public function testGetProductDynamicBundle()
349342
$product = $this->selectionPrice->getProduct();
350343
$this->assertEquals($this->productMock, $product);
351344
}
345+
346+
public function testGetAmount()
347+
{
348+
$this->setupSelectionPrice();
349+
350+
$price = 10.;
351+
$amount = 20.;
352+
353+
$this->priceInfoMock->expects($this->once())
354+
->method('getPrice')
355+
->with(\Magento\Bundle\Pricing\Price\FinalPrice::PRICE_CODE)
356+
->willReturn($this->finalPriceMock);
357+
358+
$this->finalPriceMock->expects($this->once())
359+
->method('getValue')
360+
->willReturn($price);
361+
362+
$this->discountCalculatorMock->expects($this->once())
363+
->method('calculateDiscount')
364+
->with($this->bundleMock, $price)
365+
->willReturn($price);
366+
367+
$this->priceCurrencyMock->expects($this->once())
368+
->method('round')
369+
->with($price)
370+
->willReturn($price);
371+
372+
$this->bundleMock->expects($this->any())
373+
->method('getPriceType')
374+
->willReturn(\Magento\Bundle\Model\Product\Price::PRICE_TYPE_DYNAMIC);
375+
376+
$this->calculatorMock->expects($this->once())
377+
->method('getAmount')
378+
->with($price, $this->productMock, null)
379+
->willReturn($amount);
380+
381+
$this->assertEquals($amount, $this->selectionPrice->getAmount());
382+
}
352383
}

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ protected function getBundleHeader()
246246
[
247247
'targetName' => 'product_form.product_form.'
248248
. self::CODE_BUNDLE_DATA . '.' . self::CODE_BUNDLE_OPTIONS,
249-
'actionName' => 'addChild',
249+
'actionName' => 'processingAddChild',
250250
]
251251
],
252252
],
@@ -272,7 +272,6 @@ protected function getBundleOptions()
272272
'template' => 'ui/dynamic-rows/templates/collapsible',
273273
'label' => '',
274274
'additionalClasses' => 'admin__field-wide',
275-
'itemTemplate' => 'record',
276275
'collapsibleHeader' => true,
277276
'columnsHeader' => false,
278277
'deleteProperty' => false,
@@ -324,18 +323,23 @@ protected function getBundleOptions()
324323
'additionalClasses' => 'admin__field-wide',
325324
'component' => 'Magento_Ui/js/dynamic-rows/dynamic-rows-grid',
326325
'template' => 'ui/dynamic-rows/templates/default',
327-
'renderDefaultRecord' => true,
328326
'columnsHeader' => false,
329327
'columnsHeaderAfterRender' => true,
330-
'recordTemplate' => 'record',
331328
'provider' => 'product_form.product_form_data_source',
332329
'dataProvider' => '${ $.dataScope }' . '.bundle_button_proxy',
330+
'identificationDRProperty' => 'product_id',
331+
'identificationProperty' => 'product_id',
333332
'map' => [
334-
'id' => 'entity_id',
335333
'product_id' => 'entity_id',
336334
'name' => 'name',
337335
'sku' => 'sku',
338336
'price' => 'price',
337+
'delete' => '',
338+
'selection_can_change_qty' => '',
339+
'selection_id' => '',
340+
'selection_price_type' => '',
341+
'selection_price_value' => '',
342+
'selection_qty' => '',
339343
],
340344
'links' => [
341345
'insertData' => '${ $.provider }:${ $.dataProvider }'

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/Composite.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ public function modifyData(array $data)
124124
'selection_can_change_qty' => $productLink->getCanChangeQuantity(),
125125
'selection_qty_is_integer' => (bool)$integerQty,
126126
'position' => $productLink->getPosition(),
127+
'delete' => '',
127128
];
128129
}
129130
$data[$modelId][BundlePanel::CODE_BUNDLE_OPTIONS][BundlePanel::CODE_BUNDLE_OPTIONS][] = [

app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,11 @@ protected function _getHtmlSelect($name, $value = null)
200200
}
201201
$extraParams .= ' data-role="calendar-dropdown" data-calendar-role="' . $name . '"';
202202
$extraParams .= ' data-selector="' . $select->getName() . '"';
203-
$select->setExtraParams($extraParams);
203+
if ($this->getOption()->getIsRequire()) {
204+
$extraParams .= ' data-validate=\'{"datetime-validation": true}\'';
205+
}
204206

207+
$select->setExtraParams($extraParams);
205208
if ($value === null) {
206209
$value = $this->getProduct()->getPreconfiguredValues()->getData(
207210
'options/' . $option->getId() . '/' . $name

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ public function __construct(
3333
* Reindex single row by id
3434
*
3535
* @param int $id
36+
* @param bool $forceReindex
3637
* @return void
3738
*/
38-
public function reindexRow($id)
39+
public function reindexRow($id, $forceReindex = false)
3940
{
40-
if (!$this->_state->isFlatEnabled() || $this->getIndexer()->isScheduled()) {
41+
if (!$this->_state->isFlatEnabled() || (!$forceReindex && $this->getIndexer()->isScheduled())) {
4142
return;
4243
}
4344
$this->getIndexer()->reindexRow($id);
@@ -47,11 +48,12 @@ public function reindexRow($id)
4748
* Reindex multiple rows by ids
4849
*
4950
* @param int[] $ids
51+
* @param bool $forceReindex
5052
* @return void
5153
*/
52-
public function reindexList($ids)
54+
public function reindexList($ids, $forceReindex = false)
5355
{
54-
if (!$this->_state->isFlatEnabled() || $this->getIndexer()->isScheduled()) {
56+
if (!$this->_state->isFlatEnabled() || (!$forceReindex && $this->getIndexer()->isScheduled())) {
5557
return;
5658
}
5759
$this->getIndexer()->reindexList($ids);

0 commit comments

Comments
 (0)