Sorry I'm reposting this as I posted a response to a closed issue: http://drupal.org/node/1200172. I didn't know how to retract the post.
I have a multiattribute product display with two problems.
1) the multiattribute select list is empty. The label and dropdown controls are there but there are no values. The values are entered in the respective product listing field.
2) I have a second, unwanted, select list in the product display of the product titles for products referenced in product reference. This field is not checked for this capability in the product listing--the field is uneditable. How do I remove this?
Comments
Comment #1
damien tournoud commentedThis looks like a bug report for now. Your two issues are one the consequence of the other: because the power field is not picked up properly, the add to cart for renders the other available products (listed by their titles) in an additional drop-down.
Comment #2
dbkern commentedThanks--I feel a bit less stupid--but I guess I'll still have to hold tight until someone much better at this than me resolves the issue. What can I do to help someone fix this?
Comment #3
damien tournoud commentedOk, it is actually a core bug. In a nutshell:
List (float)relies on comparing float values for equality and as a consequence is *utterly broken*.If you input
0.0as an allowed value, it will be stored as:(int) 0as the key of the allowed values,If you input
1.5as an allowed value, it will be stored as:(string) '1.5'as the key of the allowed values because PHP only supports integers and strings as keys to associative arraysAs a consequence, all the comparisons between the value stored in the database and the allowed value list just fail (including the one that generates the selected value in the widget form...).
Short term, you can workaround the issue by not using a
List (float)type but instead aList (text)orList (integer).Comment #4
dbkern commentedDamien,
Many thanks! I switched the keys in the multiattribute field to all integers and the select list in the display is now populated and the unwanted dropdown is gone.
Comment #11
alexpottWe've fixed this in Drupal - we store floats in config as real floats like
If you enter both 0 and 0.0 in the initial default value list the system is clever enough to work out these are the same value and you only end up with one allowed value.