Voting starts in March for the Drupal Association Board election.
Sometimes the tabs randomly change position, not paying attention to the order allocated by the form.
Hmm, possibly a bug introduced by the recent conversion in how we process tabs. Previously we explicitly assigned weights. I stripped out that code because it didn't seem to be needed any more, but possibly I was wrong....
Meantime you could explicitly assign #weight properties to your tabpage elements, but we should identify and fix this issue.
Ah, thanks, that works perfectly! I have a loop to generate the items and just added:
'#weight' => $tabcount++,
and it does exactly what it needs to.
Looks like the weights might be a necessity!
Hmm, apparently editing the weights doesn't completely fix the order the tabs want to take. Now the 'last' class is assigned to something that's not the last tab. For me, the second to last tab takes the class "last". Screenshot of tabs structure attached.
FWIW, I'm seeing the same problem on a site I'm working on now using 6.x-1.2 of tabs. Manually setting the weight does the trick for me, too...
I haven't reproduced this issue. Could someone post the code that produces broken tabs?
I committed a fix to the error with first and last classes (moved to js rather than PHP, which ran before sorting by weight).
if no "#weight" is given then the order declaration is not kept
try using at least 4 tabs that should reveal the problem
using tabs 1.3
It seems this is as simple to fix as re-adding the code that added the weights??
This has just begun to happen for me after an update. No idea why. It worked fine on local dev server, but broke on live after update. Tab order is all over the place. Increasing the priority, since if the tabs module can't consistently order tabs created via the hook something is quite wrong! Testing now.
Adding weight seems to fix this - but something is wrong. Normally when you output an array without specifying weight the order is the order of the array. What I'm seeing is sometimes this is the case, but some other times (and it seems arbitrary) the array order is ignored and some seemingly completely random order is applied instead. There also doesn't seem to be anything in particular that triggers this random behaviour.
In short, it seems manually applying weight is a workaround, but not a fix.
Drupal is a registered trademark of Dries Buytaert.