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.

Comments

bastnic’s picture

Status: Active » Needs review
b-prod’s picture

I 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 to variable_realm_status() for each realm on variables rebuilt. That ensures that all realms get a weight.

The patch below only fixes the asort issue.

jose reyero’s picture

Status: Needs review » Fixed

Committed, thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.