Skip to content

Commit b863051

Browse files
author
Andrii Kasian
committed
MAGETWO-37213: Unable to create fixed bundle product
1 parent 4648956 commit b863051

File tree

2 files changed

+10
-6
lines changed
  • app/code/Magento/Bundle
    • Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes
    • Test/Unit/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes

2 files changed

+10
-6
lines changed

app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,11 @@ public function getOptions()
111111
public function isDisabledField()
112112
{
113113
return $this->_getData('is_disabled_field')
114-
|| $this->getProduct()->getId()
115-
&& ($this->getAttribute()->getAttributeCode() === 'price'
116-
|| $this->getElement()->getReadonly()
117-
);
114+
|| ($this->getProduct()->getId()
115+
&& $this->getAttribute()->getAttributeCode() === 'price'
116+
)
117+
|| $this->getElement()->getReadonly();
118+
118119
}
119120

120121
/**

app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/ExtendTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ public function setUp()
4040
public function getProduct()
4141
{
4242
$product = $this->getMockBuilder(Product::class)->disableOriginalConstructor()->getMock();
43-
$this->registry->expects($this->once())->method('registry')->with('product')->will(
43+
$this->registry->expects($this->once())
44+
->method('registry')
45+
->with('product')
46+
->will(
4447
$this->returnValue($product)
4548
);
4649
return $product;
@@ -70,4 +73,4 @@ public function testGetExtendedElement()
7073
$this->object->setIsDisabledField(true);
7174
$this->object->getExtendedElement($switchAttributeCode);
7275
}
73-
}
76+
}

0 commit comments

Comments
 (0)