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 authored and davidverholen committed Jan 6, 2019
1 parent 908a6bb commit 0edcd20
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 @@ -295,6 +295,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 0edcd20

Please sign in to comment.