In my scenario I have a vocabulary that I am using. I disabled the expanded field on the menu, and set the order how I wanted. Anytime I edit a term from the taxonomy administration, the menu settings are reset, and the menu item is added to the end of the list, thus boogering up the order.

CommentFileSizeAuthor
#1 taxonomy_menu.module.patch1.68 KBcangeceiro

Comments

cangeceiro’s picture

Status: Active » Needs review
StatusFileSize
new1.68 KB

I was able to find a fix, here is a patch that makes _taxonomy_menu_save($item) check to see if the menu item already exists before saving, and retaining prior weight and expanded settings if they are already set.

indytechcook’s picture

Title: Taxonomy Menu overwrites menu settings when saving term » Menu settings lost in update (including weight)

THanks cangeceiro. I like that fix. I'm sending people from the other issue over here to test.

mxt’s picture

(I'm coming from http://drupal.org/node/722264 )

I applyed tha patch and things seams working better.

Now I have this issue:

  1. Try to add a child term in Taxonomy > Add term (assigning no weight)
  2. Term is added as LAST CHILD in the right branch, but it's added to the end of the list regardless of alphabetical order
  3. Now clicking on "reset to alphabetical" in Taxonomy > List doesn't have any effect in taxonomy menu (in Taxonomy > list terms are correctly alphabetically ordered instead)
  4. Rebuilding the menu in taxonomy > edit-vocaboulary with "Select to rebuild the menu on submit." checked, all things were reordered correctly also in Taxomomy menu (now in alphabetical order like Taxonomy > list);

I also have issues using Taxonomy Manager but I'll explain it in another thread.

How can this issue be resolved?

Thank you !

MXT
(sorry for my bad english)

ajs17’s picture

If you have the "Display number of items" setting selected on the vocabulary settings screen, then every time you save an associated node, the menu order changes unexpectedly, even after the above patch and the patch from http://drupal.org/node/705944 are applied. I've spent several hours looking at the code and experimenting with different settings, and don't have a full explanation yet for why this is happening, but it seems to have something to do with updating the menu items to reflect changes in the number of associated nodes in the menu link title and path. Turning this setting off reverts the menu back to term weight ordering.

indytechcook’s picture

The problem with out I redid the menu item is a bug in general. It has to be reworked but I'm not exactly sure how yet. The problem occurs every time you attempt to add a menu item. While I could just call the rebuild function, this is would cause very poor performance.

Basically, we have to figure out where the item is supposed to be and adjust all menu item after it. I'm afraid there isn't a better way. The patch above does fix the weight issue when an item is updated.

indytechcook’s picture

Status: Needs review » Needs work
boabjohn’s picture

Had same issue. Applied patch and looks good. Will continue to monitor.

Out of curiosity, there seems to be recurring requests or confusion over the rebuild menu action. The objection is that it will slow (or stall) production sites due to overhead.

Is it possible to make this action available to cron or some other scheduler? I'd like to set a nightly rebuild, for example, just to make sure everything is staying in sync.

Cheers, and thanks hugely for the module!

alb’s picture

first patch resolve problem if I change a name an item no more problem in the order of the list;

but when I change a position of an item is necessary to click on Select to rebuild the menu on submit.
isn't possible automatically update the list?
this because in this area
admin/content/taxonomy/edit/vocabulary/id vocabulary
I prefer that an user, that must only add terms, is better that not use;

is necessary apply also this patch
http://drupal.org/node/705944 ?

alb’s picture

see that when one move the position of a items is necessary to rebuild the list (there is a specific function), in the code which is the
point where the code 'reknow' that an element is moved form its initially position;
so in that poin think is possible to recall the function rebuild

indytechcook’s picture

Status: Needs work » Fixed

This batch has been committed: http://drupal.org/node/767734. Thanks cangeceiro!

It works very well with this patch (which also is part of 2.6: #705944: Taxonomy menu is always rebuild, never updated.

andrewsuth’s picture

I opened a new issue with some problems related to this patch.

See: http://drupal.org/node/780720

Status: Fixed » Closed (fixed)

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