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.

Update slug.

Matthew Kennedya0794cfdf102
diff --git a/core/app/models/spree/cms_page.rb b/core/app/models/spree/cms_page.rb
index 43afb3ee50..a650c43a4f 100644
--- a/core/app/models/spree/cms_page.rb
+++ b/core/app/models/spree/cms_page.rb
@@ -53,13 +53,15 @@ module Spree
private
def handle_slug
- return if homepage?
-
- self.slug = if slug.blank?
- title.to_url
- else
- slug.to_url
- end
+ if homepage?
+ self.slug = nil
+ else
+ self.slug = if slug.blank?
+ title.to_url
+ else
+ slug.to_url
+ end
+ end
end
end
end