Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fix Rails 5.2 attachment presence CMS sections. (#11205)

Matthew Kennedya59275fd1ea7
diff --git a/frontend/app/views/spree/shared/cms/sections/_hero_image.html.erb b/frontend/app/views/spree/shared/cms/sections/_hero_image.html.erb
index ca08c15236..06597110da 100644
--- a/frontend/app/views/spree/shared/cms/sections/_hero_image.html.erb
+++ b/frontend/app/views/spree/shared/cms/sections/_hero_image.html.erb
@@ -10,7 +10,7 @@
<div class="col-12 homepage-hero-image position-relative p-0 <%= section_padding %>">
<div class="bg-light" style="--aspect-ratio:12/5;">
- <% if section.image_one.present? %>
+ <% if section.image_one.attached? %>
<!-- SM to MD -->
<img class="d-block d-md-none lazyload"
diff --git a/frontend/app/views/spree/shared/cms/sections/_side_by_side_images.html.erb b/frontend/app/views/spree/shared/cms/sections/_side_by_side_images.html.erb
index 0ffaec6933..29fb9c895c 100644
--- a/frontend/app/views/spree/shared/cms/sections/_side_by_side_images.html.erb
+++ b/frontend/app/views/spree/shared/cms/sections/_side_by_side_images.html.erb
@@ -79,7 +79,7 @@
class: "d-flex align-items-end justify-content-center bg-light text-center overflow-hidden homepage-bottom-box #{'pointer-events-none cursor-default' unless link_two}",
style: '--aspect-ratio:54/35;' do %>
- <% if section.image_two.present? %>
+ <% if section.image_two.attached? %>
<!-- XS to MD -->
<img class="d-md-none lazyload"
data-src="<%= main_app.url_for(section.img_two_md) %>"