mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-06 22:36:07 +00:00
Initialise product.variant_names
Not initialising `product.variant_names` causes it to become the string "undefinedVariant1Variant2" while it should just be "Variant1Variant2". This mistake did not matter when `variant_names` was just used to search for a sub-string. A recent change to search only for the beginning of a word, caused this to fail. See: https://github.com/openfoodfoundation/openfoodnetwork/pull/1545
This commit is contained in:
@@ -42,6 +42,7 @@ Darkswarm.factory 'Products', ($resource, Enterprises, Dereferencer, Taxons, Pro
|
||||
registerVariants: ->
|
||||
for product in @products
|
||||
if product.variants
|
||||
product.variant_names = ""
|
||||
product.variants = for variant in product.variants
|
||||
variant = Variants.register variant
|
||||
if product.name != variant.name_to_display
|
||||
|
||||
Reference in New Issue
Block a user