Closed (fixed)
Project:
Webform
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Anonymous (not verified)
Created:
5 Jan 2005 at 09:31 UTC
Updated:
25 Jan 2005 at 21:15 UTC
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.
| Comment | File | Size | Author |
|---|---|---|---|
| webform_0.patch | 1.41 KB | Anonymous (not verified) |
Comments
Comment #1
jhriggs commentedThe 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.
Comment #2
ullgren commentedNow 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
Comment #3
(not verified) commented