From 2cd36ca2b360692de39ee0ee0ffc3e3105de429f Mon Sep 17 00:00:00 2001 From: DPN MW Date: Sun, 8 Mar 2026 06:16:58 -0400 Subject: [PATCH] Bug fixes and tweaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both hero_card_enabled and hero_image_first were crashing on the same line — they both use << to append to hero_classes. The single fix +"cl-hero" makes the string mutable, so both appends on lines 144 and 145 now work. --- lib/community_landing/page_builder.rb | 2 +- plugin.rb | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/community_landing/page_builder.rb b/lib/community_landing/page_builder.rb index ab739c6..1cb088e 100644 --- a/lib/community_landing/page_builder.rb +++ b/lib/community_landing/page_builder.rb @@ -140,7 +140,7 @@ module CommunityLanding hero_style_parts << "border-bottom: 1px #{hero_border} var(--cl-border);" if hero_border.present? && hero_border != "none" hero_style_parts << "min-height: #{hero_min_h}px;" if hero_min_h.to_i > 0 hero_attr = hero_style_parts.any? ? " style=\"#{hero_style_parts.join(' ')}\"" : "" - hero_classes = "cl-hero" + hero_classes = +"cl-hero" hero_classes << " cl-hero--card" if hero_card hero_classes << " cl-hero--image-first" if hero_img_first html << "
\n" diff --git a/plugin.rb b/plugin.rb index 08bb83f..f7a4a5b 100644 --- a/plugin.rb +++ b/plugin.rb @@ -54,9 +54,19 @@ after_initialize do render html: html.html_safe, layout: false, content_type: "text/html" rescue => e - Rails.logger.error("[CommunityLanding] 500 error: #{e.class}: #{e.message}\n#{e.backtrace&.first(10)&.join("\n")}") - render html: "".html_safe, - layout: false, content_type: "text/html", status: 500 + bt = e.backtrace&.first(15)&.join("\n") rescue "" + error_page = <<~HTML + + Landing Page Error + + +

CommunityLanding Error

+

#{ERB::Util.html_escape(e.class)}: #{ERB::Util.html_escape(e.message)}

+
#{ERB::Util.html_escape(bt)}
+ + HTML + render html: error_page.html_safe, layout: false, content_type: "text/html", status: 500 end private