When using variable_realm as explained here : http://drupalcode.org/project/variable.git/blob/refs/heads/7.x-1.x:/vari...
The $weight value is never used, for two reasons :
- first, if $variables is given directly in add or switch methods, the variable_realm_weight function is never called
- and then, in variable_realm_weight, the sort is made with ksort instead of asort, so realm are sorted by name (so alphanumeric) instead of weight
Attached patch correct this.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | variable_realm-weight-is-ignored-1370518-2.patch | 605 bytes | b-prod |
| variable_realm.patch | 1.12 KB | bastnic |
Comments
Comment #1
bastnic commentedComment #2
b-prod commentedI totally agree with the asort use, for which I initially wanted to provide a patch.
About the systematic call to the
variable_realm_weight()function, I do not think it is necessary since there is a call tovariable_realm_status()for each realm on variables rebuilt. That ensures that all realms get a weight.The patch below only fixes the asort issue.
Comment #3
jose reyero commentedCommitted, thanks.