freakdesign / shopify-custom-fields

A javascript tool to emulate Custom Fields within the Shopify dashboard.
http://freakdesign.com.au/pages/shopify-custom-fields
132 stars 24 forks source link

Namespaces with the same name key are not populated correctly. #25

Open er1 opened 8 years ago

er1 commented 8 years ago

Fields which have the same key name but different namespaces are not populated correctly. One value is repeated across all fields with the same key name. This is only an issue with reading, writing works as expected the proper values however since the values were read wrong the old values get clobbered.

Reproduce by defining fields c_f.test and custom_fields.test. Go to a product and set both values (I used custom_fields.test = apples and c_f.test = oranges). Reload the product and examine the values, one of them is repeated (I had custom_fields.test = oranges and c_f.test = oranges)

freakdesign commented 8 years ago

Yeah, I can see why that might be an issue. The custom_fields and c_f namespaces are considered to be the same thing (for legacy support when I changed the default namespace). There's nothing clever in place to see them as different.

I see how this can be a problem if someone does have both in place. Worth marking as a bug to finally better handle that. Thanks for the heads up.