From cc20fee5d7fa6eba2eddac4c1ac45fd0f4fcc161 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Gaya?= <sebastien.gaya@gmail.com>
Date: Tue, 16 Nov 2021 11:54:41 +0100
Subject: [PATCH] check variable

---
 app/views/admin/communication/website/pages/show.html.erb | 2 +-
 app/views/admin/communication/website/posts/show.html.erb | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/views/admin/communication/website/pages/show.html.erb b/app/views/admin/communication/website/pages/show.html.erb
index d3808672e..8353c826d 100644
--- a/app/views/admin/communication/website/pages/show.html.erb
+++ b/app/views/admin/communication/website/pages/show.html.erb
@@ -68,7 +68,7 @@
         </tbody>
       </table>
     </div>
-    <% if @page.featured_image.attached? %>
+    <% if @page.featured_image.attached? && @page.featured_image.variable? %>
       <div class="card flex-fill w-100">
         <div class="card-header">
           <h5 class="card-title mb-0"><%= t('activerecord.attributes.communication/website/page.featured_image') %></h5>
diff --git a/app/views/admin/communication/website/posts/show.html.erb b/app/views/admin/communication/website/posts/show.html.erb
index 3e44d2c44..c8a0354c1 100644
--- a/app/views/admin/communication/website/posts/show.html.erb
+++ b/app/views/admin/communication/website/posts/show.html.erb
@@ -56,7 +56,7 @@
         </tbody>
       </table>
     </div>
-    <% if @post.featured_image.attached? %>
+    <% if @post.featured_image.attached? && @post.featured_image.variable? %>
       <div class="card flex-fill w-100">
         <div class="card-header">
           <h5 class="card-title mb-0"><%= t('activerecord.attributes.communication/website/post.featured_image') %></h5>
-- 
GitLab