mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-14 04:04:23 +00:00
Consider deleted products when creating permalinks
https://github.com/openfoodfoundation/openfoodnetwork/issues/3844 Spree's implementation and our implementation to create a unique permalink failed to notice conflicts with soft-deleted products. This patch looks at deleted products as well.
This commit is contained in:
@@ -252,6 +252,7 @@ Spree::Product.class_eval do
|
||||
raise
|
||||
end
|
||||
|
||||
# Spree creates a permalink already but our implementation fixes an edge case.
|
||||
def sanitize_permalink
|
||||
if permalink.blank? || permalink_changed?
|
||||
requested = permalink.presence || permalink_was.presence || name.presence || 'product'
|
||||
|
||||
Reference in New Issue
Block a user