Ubercart product design wrongly assumes that non Ubercart fields will always be set to 0 or something like that.
CCK is almost enabled in any Drupal install, and this module allows the ordering of all node fields.
Every time the order of fields is changed on the content type xxx, the weight value in content_extra_weight_xxx increases and soon goes beyond 10.
Ubercart only allows to set its fields weight between -10 and +10.
This is definitely a wrong design, as Ubercart should rely on the _content_extra_weight() hook for ordering its fieldset, not handling its own conflicting weighing.
In the meantime, I changed in uc_product.admin.inc ,
function uc_product_field_settings_form() {
...
$form['fields'][$label]['weight'] = array(
'#type' => 'weight',
- '#delta' => 10,
+ '#delta' => 100,
'#default_value' => $field['weight'],
);
Comments
Comment #1
longwaveI committed a change to increase #delta from 10 to 50, as 50 seems to be the highest delta value used by most other modules - 100 makes the dropdown less manageable and seems unnecessary.
Attempts were made in #333085: Field weight order using CCK interface to convert the product fields to use the standard CCK UI but this was ultimately never committed, and it is too late now to change this in 6.x-2.x. In 7.x-3.x, fields are managed using the same interface as core fields.
Comment #2
jvieille commentedI had values more than 50, this is why I set 100...
This is certainly because I made so many changes to this form, this might not happen anymore, but the 100 value does not hurt.
Thanks