Skip to content

Commit e7b9f52

Browse files
committed
MAGETWO-53583: "Use Default" checkbox is checked again after saving empty fields (description, name, etc)
- fixed integration build
1 parent dba799f commit e7b9f52

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

app/code/Magento/Eav/Model/Entity/Attribute/AbstractAttribute.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ abstract class AbstractAttribute extends \Magento\Framework\Model\AbstractExtens
2222
{
2323
const TYPE_STATIC = 'static';
2424

25+
/**
26+
* Const for empty string value.
27+
*/
28+
const EMPTY_STRING = '';
29+
2530
/**
2631
* Attribute name
2732
*
@@ -621,7 +626,7 @@ public function isValueEmpty($value)
621626
return (is_array($value) && count($value) == 0)
622627
|| $value === null
623628
|| ($value === false && $this->getBackend()->getType() != 'int')
624-
|| ($value === '' && $this->isInEmptyStringTypes());
629+
|| ($value === self::EMPTY_STRING && $this->isInEmptyStringTypes());
625630
}
626631

627632
/**
@@ -632,7 +637,7 @@ public function isValueEmpty($value)
632637
*/
633638
public function isAllowedEmptyTextValue($value)
634639
{
635-
return $this->isInEmptyStringTypes() && $value === '';
640+
return $this->isInEmptyStringTypes() && $value === self::EMPTY_STRING;
636641
}
637642

638643
/**

dev/tests/integration/testsuite/Magento/Eav/Model/ResourceModel/UpdateHandlerTest.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@
1111
/**
1212
* @magentoAppArea adminhtml
1313
* @magentoAppIsolation enabled
14+
* @magentoDbIsolation enabled
1415
*/
1516
class UpdateHandlerTest extends \PHPUnit_Framework_TestCase
1617
{
1718
/**
18-
* @magentoAppIsolation enabled
19-
* @magentoDbIsolation enabled
2019
* @covers \Magento\Eav\Model\ResourceModel\UpdateHandler::execute
2120
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
2221
* @dataProvider getAllStoresDataProvider
@@ -51,8 +50,6 @@ public function testExecuteProcessForAllStores($code, $snapshotValue, $newValue,
5150
}
5251

5352
/**
54-
* @magentoAppIsolation enabled
55-
* @magentoDbIsolation enabled
5653
* @covers \Magento\Eav\Model\ResourceModel\UpdateHandlerTest::execute
5754
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
5855
* @magentoDataFixture Magento/Store/_files/second_store.php
@@ -95,8 +92,6 @@ public function testExecuteProcessForCustomStore($code, $snapshotValue, $newValu
9592
}
9693

9794
/**
98-
* @magentoAppIsolation enabled
99-
* @magentoDbIsolation enabled
10095
* @covers \Magento\Eav\Model\ResourceModel\UpdateHandlerTest::execute
10196
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
10297
* @magentoDataFixture Magento/Catalog/_files/dropdown_attribute.php

0 commit comments

Comments
 (0)