Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This was surprising. Basically when you set the node weight, the shipping weight also changes to that exact same integer value. This in itself is not the end of the world, but if you try to set a negative value, ubercart throws an error because you can't have a negative 'weight'.
It seems like this is a namespace issue. Is it possible to have the node weight form use a different key value to prevent conflicts?
Comment | File | Size | Author |
---|---|---|---|
#3 | 1539766-weight-namespaces-3.patch | 771 bytes | rickmanelius |
Comments
Comment #1
davisbenI changed $node->weight to $node->weight_weight, which should eliminate this problem.
Comment #2
rickmanelius CreditAttribution: rickmanelius commented@10oclock Thanks!
Comment #3
rickmanelius CreditAttribution: rickmanelius commentedActually, there were two locations that needed to be fixed. The first is $entity->weight_weight and the second is the form values had to be ['weight']['weight_weight'] because the submit hook ignores the first array key and only uses the second in $form_state['values'].
Attached is a patch.
Comment #4
davisbenThanks for the patch! Applied and committed to 7.x-2.x.