Skip to content

Commit 6792fbf

Browse files
committed
MC-31304: [ElasticSearch] Exception on catalog search result page
1 parent 551711a commit 6792fbf

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

app/code/Magento/Eav/Model/Config.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,7 @@ protected function _createAttribute($entityType, $attributeData)
839839
}
840840
/** @var AbstractAttribute $attribute */
841841
$attribute = $this->createAttribute($model)->setData($attributeData);
842+
$attribute->setOrigData('entity_type_id', $attribute->getEntityTypeId());
842843
$this->_addAttributeReference(
843844
$attributeData['attribute_id'],
844845
$code,

app/code/Magento/Eav/Test/Unit/Model/ConfigTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,13 @@ public function testGetAttributes($cacheEnabled)
223223
->method('getData')
224224
->willReturn([$attributeData]);
225225
$entityAttributeMock = $this->getMockBuilder(Attribute::class)
226-
->setMethods(['setData', 'load', 'toArray'])
226+
->setMethods(['setData', 'setOrigData', 'load', 'toArray'])
227227
->disableOriginalConstructor()
228228
->getMock();
229229
$entityAttributeMock->method('setData')
230230
->willReturnSelf();
231+
$entityAttributeMock->method('setOrigData')
232+
->willReturn($attributeData);
231233
$entityAttributeMock->method('load')
232234
->willReturnSelf();
233235
$entityAttributeMock->method('toArray')

0 commit comments

Comments
 (0)