Firstly, thanks to cangeceiro for his work on the patch to add menu weight, etc to the taxonomy menu. (http://drupal.org/node/737478)

His comments in the patch are correct:

Set the weight. We need to do this because the menu system does not order the terms the same way that the taxonomy system does.

There are just 2 issues:

1) The variable taxonomy_menu_weight is not reset for each bulk update, so it always increases in value. After doing several test bulk updates, I managed to get to 975.

2) Issue 1 would not be a huge problem if Drupal did not have a limit to weight. I believe the range is: -50 to 50 by default. So when the modules tries to apply a weight of 975 to a menu item, it defaults to -50. So when I bulk update a menu I end up -50 for all items - which creates a real mess for my Taxonomy menu with 275 menu items.

My temporary solution is to install a small module that I found here which allows you to change the weight range.

I think to get the weight to work properly for large taxonomy vocabularies (larger than 50), it will be necessary to make a few changes:

1) Set the default value of taxonomy_menu_weight to -50 if it does not exist, not 0:

    $weight = variable_get('taxonomy_menu_weight', -50);

as it was, it would only allow for 50 new items to be added to the menu: 0 to 50.

If the default value was -50 it would atleast allow for the 100 items.

2) Delete the variable taxonomy_menu_weight everytime the bulk operation is completed. That way it will get the default value (-50) each run.

3) Add logic to the weight value assigned which corresponds to the menu system of weight.
ie. When there is a sub-menu, the weight can be reset to -50 for the first item, -49 for the second, etc - but for the next menu item (not part of the sub-menu), it will need to reassume from the previous weight value. (does this make sense?)

Andrew

Comments

indytechcook’s picture

indytechcook’s picture

Status: Active » Fixed

Committed a change that reversed this change: #641036: Items not correctly orderd by alphabet

Please test the latest dev.

tomsm’s picture

I tested the latest dev. This is fixed.

tomsm’s picture

Priority: Normal » Critical

Sorry, but when I select "Reset to alphabetical" the terms are sometimes not sorted in the menu.
Only when I manually drag the term to its correct place, the menu is updated correctly.

The problem is that it does not happen always.

It only happens when I manually switch the first and second term. Then I select "Reset to alphabetical" and the two terms are not correctly sorted in the menu.

I also have this problem with my previous version 6.x-2.4-beta1.

tomsm’s picture

Priority: Critical » Normal
Status: Fixed » Needs work

It is not critical.

indytechcook’s picture

Priority: Critical » Normal

tomsm, I think the problem is related to #641036: Items not correctly orderd by alphabet for international characters. The problem is that the order that the taxonomy module uses on the taxonomy sort page and the order the menu system uses to render the the order of the menu items is different. I had a temp fix in place that caused all sort of other problems so I backed it out.

Please confirm the order is for international characters.

tomsm’s picture

Well, the two terms are in English. The first term is "Cold Therapy" and the second "Consumer Goods".
When I put "Consumer Goods" above "Cold Therapy", click on "Reset to alphabetical" and then click "Save", the two terms are not sorted alphabetical: Consumer Goods remains above Cold Therapy.

My source language is English.

I think that these terms do not have any international characters, right?

marcoka’s picture

if i add menu items to the menu by hand and lik them to a node, and reposition the elements, an edit of the settings and save, resets the order/weight of the menu items

endiku’s picture

indytechcook’s picture

Status: Needs work » Closed (duplicate)

Relating this issue to the original and setting this to duplicate. There has been several code change that make many comments in this issue irrelevant.

Cheers

#641036: Items not correctly orderd by alphabet