From 74d871c6ce7e5b7c533bcde2adcab0bf541391be Mon Sep 17 00:00:00 2001
From: Arnaud Levy <contact@arnaudlevy.com>
Date: Fri, 12 Jan 2024 12:38:13 +0100
Subject: [PATCH] Fix empty galleries

---
 app/models/communication/block/template/gallery.rb | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/app/models/communication/block/template/gallery.rb b/app/models/communication/block/template/gallery.rb
index 17d6cfdca..c8adbc7ac 100644
--- a/app/models/communication/block/template/gallery.rb
+++ b/app/models/communication/block/template/gallery.rb
@@ -4,4 +4,7 @@ class Communication::Block::Template::Gallery < Communication::Block::Template::
   has_layouts [:grid, :carousel]
   has_component :description, :rich_text
 
+  def empty?
+    elements.none?
+  end
 end
-- 
GitLab