Skip to content

Commit

Permalink
Fix issue - Image custom attribute type could not display on frontend.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nazar65 committed Nov 5, 2018
1 parent 0d99fa8 commit e3134ea
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/code/Magento/Eav/Model/Entity/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,12 @@ public function beforeSave()
}
}

if ($this->getFrontendInput() == 'media_image') {
if (!$this->getFrontendModel()) {
$this->setFrontendModel(\Magento\Catalog\Model\Product\Attribute\Frontend\Image::class);
}
}

if ($this->getBackendType() == 'gallery') {
if (!$this->getBackendModel()) {
$this->setBackendModel(\Magento\Eav\Model\Entity\Attribute\Backend\DefaultBackend::class);
Expand Down

0 comments on commit e3134ea

Please sign in to comment.