Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 477ca51

Browse files
committed
Don't set a source model on the attribute when it's not needed. This avoids accidentally persisting the source model to the database when using multiselect attributes.
1 parent 547ad4a commit 477ca51

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,9 +608,11 @@ public function getSource()
608608
{
609609
if (empty($this->_source)) {
610610
if (!$this->getSourceModel()) {
611-
$this->setSourceModel($this->_getDefaultSourceModel());
611+
$this->_source = $this->_getDefaultSourceModel();
612+
} else {
613+
$this->_source = $this->getSourceModel();
612614
}
613-
$source = $this->_universalFactory->create($this->getSourceModel());
615+
$source = $this->_universalFactory->create($this->_source);
614616
if (!$source) {
615617
throw new LocalizedException(
616618
__(

0 commit comments

Comments
 (0)