Skip to content

Commit 00f64b0

Browse files
[2.3-develop] Forwardport of #12736
1 parent 8c705bf commit 00f64b0

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php

+1
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,7 @@ public function load($printQuery = false, $logQuery = false)
920920
foreach ($this->_items as $item) {
921921
$item->setOrigData();
922922
$this->beforeAddLoadedItem($item);
923+
$item->setDataChanges(false);
923924
}
924925
\Magento\Framework\Profiler::stop('set_orig_data');
925926

app/code/Magento/Eav/Test/Unit/Model/Entity/Collection/AbstractCollectionTest.php

+15
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,21 @@ public function tearDown()
135135
$this->model = null;
136136
}
137137

138+
/**
139+
* Test method \Magento\Eav\Model\Entity\Collection\AbstractCollection::load
140+
*/
141+
public function testLoad()
142+
{
143+
$this->fetchStrategyMock
144+
->expects($this->once())
145+
->method('fetchAll')
146+
->will($this->returnValue([['id' => 1, 'data_changes' => true], ['id' => 2]]));
147+
148+
foreach ($this->model->getItems() as $item) {
149+
$this->assertFalse($item->getDataChanges());
150+
}
151+
}
152+
138153
/**
139154
* @dataProvider getItemsDataProvider
140155
*/

0 commit comments

Comments
 (0)