We have a couple products types with fields where the "Enable this field to function as an attribute field on Add to Cart form" option is checked. Eg for a size and color field of a product. These fields are configured as "list (text)" and not as a taxonomy term reference (I think that was the only way to get it working a long time ago...). Now if we add new products, the fields on the add to cart form no longer appear, you can just select on the title of the product and no longer on color, size etc.
For existing products, the add to cart form fields still work like before, so I didn't notice this at first. I did some tests and as far as I see now, the add to cart form fields works like expected if I configure the fields as taxonomy term references or even for list (text) fields if I configure a new one. It's just the usage of a color/size from an existing field on a new product that seems to be broken.
Could this be an upgrade issue for 1.4? I already tried to resave the existing fields and toggle the add to cart form attribute option, but that doesn't help.
Comments
Comment #1
rszrama commentedThere shouldn't be any issues updating from previous versions, as this code hasn't changed significantly in a long time. I still use List (text) fields for my attribute fields as well, and the site survived an upgrade. I think we'll need to dig deeper and figure out what exactly it is about your site that the update isn't liking. But if it works for new fields, it should work for existing fields, and if it works for one type of field, it should work for another. : ?
Attempting to toggle / resave the field form would've been the first thing I tried, too. Can you provide a little more info perhaps about your product type / display node type configuration? We'll need to be able to reproduce a broken scenario before we can really figure out what went wrong, even if that means creating a test site in Commerce 1.3 and then updating it to 1.4.
And just to be sure, you ran update.php after updating the code?
Comment #2
stroobl commentedI did run update.php. (well, I use drush updatedb, but that should be the same). Everything looked fine after the update, no database update errors at all. I did some tests and we didn't see the issue till we tried to add new products.
About our setup: we have a few product types and most of them have attribute fields for color and size. In most cases, we have on product display which is linked to different products. I suppose that's used on lot's of DC sites. Maybe something less standard is that we have three "Add to Cart form settings" fields configured in our products where the customer can add text, fonts and a color to put a text on the product. Could that influence the other attribute fields?
Comment #3
rszrama commentedNope, that shouldn't interfere with attribute fields on the Add to Cart form. Don't suppose you have the ability to dump some data if I told you where to look?
Comment #4
stroobl commentedI can dump whatever you want if that can help to resolve the issue. :) Or send you an admin login on a test site to look around if you prefer that.
Comment #5
stroobl commentedI did a rollback to 1.3 (with an unaltered database) and tried to edit the products created with 1.4.
Things I noticed:
-referenced pictures in the product are gone
-color and size fields are empty
-weight (another custom field) is empty
If I edit a product created before the upgrade to 1.4 all values are normal. Once I resave the product created in 1.4 with my 1.3 the product attributes work again like it should be.
Comment #6
stroobl commentedI think this issue is related to i18n changes in 1.4. All products made with 1.3 have language "und" in both the product and custom fields. New products made with 1.4 now have the language field empty for the product and custom fields set to "nl".
Comment #7
stroobl commentedFixed by running:
update commerce_product set language='und' where language!='und';and similar queries for the fields:
update field_data_field_blabla set language='und' where language='nl';Comment #8
stroobl commentedComment #9
rszrama commentedHmm, good find. I thought we had actually changed it to function the opposite way (using und instead of '') for the 1.4 release. I wonder if a patch got missed. : ?
Comment #10
tcmug commentedManually tweaking the field languages fixes also this duplicate issue.
Comment #11
bojanz commented