I needed to create a webform that contained more than twenty different components. Because sorting by the weights is obligatory, I couldn't get the 20+ components in the right order.

I request to increase the range of weights to at least something like (-20,20).

But because I couldn't find these numbers in the webform.module, I gathered that the range that is currently in use comes from Drupal itself. Therefore, I attacked the problem in another way by sorting the components by weight and then by name. In this way users can use a natural alphabetical ordering as well.

A patchfile is attached.

CommentFileSizeAuthor
webform_0.patch1.41 KBAnonymous (not verified)

Comments

jhriggs’s picture

The weight range can be changed with the optional fourth argument passed to the form_weight() function. Its default value is 10, giving the range -10 to 10. If you pass 20 for this, you will get -20 to 20. It may still be worthwhile to sort by weight then alphabetically as this patch does, though.

ullgren’s picture

Assigned: Unassigned » ullgren

Now the module sorts the components both by weight and name.
It also uses the number of components as the fourth parameter to form_weight() if the number of componenets are above 10

Anonymous’s picture