Skip to content

Commit

Permalink
Backport 2.2 - Don't set a source model on the attribute when it's no…
Browse files Browse the repository at this point in the history
…t needed. This avoids accidentally persisting the source model to the database when using multiselect attributes.

(cherry picked from commit 477ca51)
  • Loading branch information
hostep committed Oct 4, 2018
1 parent c34ced3 commit 3e066db
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,11 @@ public function getSource()
{
if (empty($this->_source)) {
if (!$this->getSourceModel()) {
$this->setSourceModel($this->_getDefaultSourceModel());
$this->_source = $this->_getDefaultSourceModel();
} else {
$this->_source = $this->getSourceModel();
}
$source = $this->_universalFactory->create($this->getSourceModel());
$source = $this->_universalFactory->create($this->_source);
if (!$source) {
throw new LocalizedException(
__(
Expand Down

0 comments on commit 3e066db

Please sign in to comment.