Skip to content

Commit 720667e

Browse files
author
Slabko,Michael(mslabko)
committed
Merge pull request #335 from magento-goinc/pr-335
[SWAT] Bug fixes
2 parents 02d786b + 082df33 commit 720667e

File tree

5 files changed

+11
-18
lines changed

5 files changed

+11
-18
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ public function __construct(
6969
* Assign stock status information to product
7070
*
7171
* @param Product $product
72-
* @param int $stockStatus
72+
* @param int $status
7373
* @return void
7474
*/
75-
public function assignStatusToProduct(Product $product, $stockStatus = null)
75+
public function assignStatusToProduct(Product $product, $status = null)
7676
{
77-
if ($stockStatus === null) {
77+
if ($status === null) {
7878
$websiteId = $product->getStore()->getWebsiteId();
7979
$stockStatus = $this->stockRegistryProvider->getStockStatus($product->getId(), $websiteId);
8080
$status = $stockStatus->getStockStatus();

app/code/Magento/CatalogInventory/Observer/AddInventoryDataObserver.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ public function execute(EventObserver $observer)
3434
{
3535
$product = $observer->getEvent()->getProduct();
3636
if ($product instanceof \Magento\Catalog\Model\Product) {
37-
$this->stockHelper->assignStatusToProduct(
38-
$product,
39-
$product->getStockStatus()
40-
);
37+
$this->stockHelper->assignStatusToProduct($product);
4138
}
4239
}
4340
}

app/code/Magento/CatalogInventory/Test/Unit/Observer/AddInventoryDataObserverTest.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,24 +57,17 @@ protected function setUp()
5757

5858
public function testAddInventoryData()
5959
{
60-
$stockStatus = true;
61-
6260
$product = $this->getMockBuilder('Magento\Catalog\Model\Product')
6361
->disableOriginalConstructor()
64-
->setMethods(['getStockStatus'])
6562
->getMock();
6663

67-
$product->expects($this->once())
68-
->method('getStockStatus')
69-
->will($this->returnValue($stockStatus));
70-
7164
$this->event->expects($this->once())
7265
->method('getProduct')
7366
->will($this->returnValue($product));
7467

7568
$this->stockHelper->expects($this->once())
7669
->method('assignStatusToProduct')
77-
->with($product, $stockStatus)
70+
->with($product)
7871
->will($this->returnSelf());
7972

8073
$this->observer->execute($this->eventObserver);

app/code/Magento/Downloadable/view/adminhtml/web/downloadable-type-handler.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ define([
6565
if (productType.type.current === 'downloadable') {
6666
weight.change(false);
6767
weight.$weightSwitcher().one('change', function () {
68-
$(document).trigger('setTypeProduct', null);
68+
$(document).trigger(
69+
'setTypeProduct',
70+
productType.type.init === 'downloadable' ? 'virtual' : productType.type.init
71+
);
6972
});
7073
this.show();
7174
} else {

app/code/Magento/UrlRewrite/view/adminhtml/templates/categories.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
<div class="content" style="clear: both;">
1414
<input type="hidden" name="categories" id="product_categories" value="" />
1515
<?php if ($block->getRoot()): ?>
16-
<div data-mage-init='<?php
16+
<div data-mage-init="<?php
1717
echo $block->escapeHtml($this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode([
1818
'categoryTree' => [
1919
'data' => $block->getTreeArray(null),
2020
'url' => $block->getLoadTreeUrl(),
2121
],
2222
]));
23-
?>' class="jstree-default"></div>
23+
?>" class="jstree-default"></div>
2424
<?php endif; ?>
2525
</div>
2626
</fieldset>

0 commit comments

Comments
 (0)