From e3134ea23a4827e8d3ef0ed2b4027b66e565f215 Mon Sep 17 00:00:00 2001 From: NazarKlovanych Date: Mon, 5 Nov 2018 18:39:01 +0200 Subject: [PATCH] Fix issue - Image custom attribute type could not display on frontend. --- app/code/Magento/Eav/Model/Entity/Attribute.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/code/Magento/Eav/Model/Entity/Attribute.php b/app/code/Magento/Eav/Model/Entity/Attribute.php index a5e31c613d17b..740b29c9676f3 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute.php @@ -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);