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 uploading svg logo

Krzysztof Kaliszaf3fd6206cf6
diff --git a/core/app/helpers/spree/base_helper.rb b/core/app/helpers/spree/base_helper.rb
index 1bfe1f31ff..016a9c01e3 100644
--- a/core/app/helpers/spree/base_helper.rb
+++ b/core/app/helpers/spree/base_helper.rb
@@ -42,8 +42,10 @@ module Spree
end
def logo(image_path = nil, options = {})
- image_path ||= if current_store.logo.attached?
+ image_path ||= if current_store.logo.attached? && current_store.logo.variable?
main_app.url_for(current_store.logo.variant(resize: '244x104>'))
+ elsif current_store.logo.image?
+ main_app.url_for(current_store.logo)
else
Spree::Config[:logo]
end
diff --git a/core/config/initializers/assets.rb b/core/config/initializers/assets.rb
index 5c508b1954..88cd14cd6b 100644
--- a/core/config/initializers/assets.rb
+++ b/core/config/initializers/assets.rb
@@ -1 +1,2 @@
Rails.application.config.assets.precompile += %w(logo/spree_50.png noimage/*.png)
+Rails.application.config.active_storage.content_types_to_serve_as_binary.delete('image/svg+xml')