Skip to content

Commit 2808b89

Browse files
committed
MAGETWO-50123: Unable to assign blank value to attribute #3545 #4910 #5485
- fixing code for code duplication as per code review
1 parent 821e2dc commit 2808b89

File tree

1 file changed

+3
-2
lines changed
  • app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier

1 file changed

+3
-2
lines changed

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,8 +540,9 @@ private function isProductNew()
540540
*/
541541
private function isProductHasValueForAttribute(ProductAttributeInterface $attribute)
542542
{
543-
return (bool)($this->locator->getProduct()->getCustomAttribute($attribute->getAttributeCode()) !== null)
544-
&& $this->locator->getProduct()->getCustomAttribute($attribute->getAttributeCode())->getValue();
543+
/** @var \Magento\Framework\Api\AttributeInterface $attributeCode */
544+
$attributeCode = $this->locator->getProduct()->getCustomAttribute($attribute->getAttributeCode());
545+
return (bool)($attributeCode !== null) && $attributeCode->getValue();
545546
}
546547

547548
/**

0 commit comments

Comments
 (0)