Right now the taxonomy hook in taxonomy_menu_taxonomy always rebuilds the menu tree.

This is a big problem in case of large vocabularies that change often (e.g. thousands of terms for freetagging). While these vocabs can be excluded from the menu by the module config, the taxonomy hook still always triggers expensive menu rebuild.

The hook should at least check that the operation applies to a vocab for which taxonomy_menu is enabled.

CommentFileSizeAuthor
#1 t_m.patch660 bytesgerhard killesreiter

Comments

gerhard killesreiter’s picture

Status: Active » Needs review
StatusFileSize
new660 bytes

Damien suggested to fix this by changing the call to menu_rebuild to a variable_set('menu_rebuild_needed', TRUE);. This means that the page request after the current one will rebuild the menu. So you can add several terms at once without calling menu_rebuiild for each term. I've treied this and it works for me, patch attached.

indytechcook’s picture

Has anyone else tested this?

indytechcook’s picture

Part of the latest Dev version for D6. I will be updated D5 this week. Good catch. This has also helped resolve a caching issues.

indytechcook’s picture

Status: Needs review » Reviewed & tested by the community

Will be included in a D5 DEV package this weekend.

indytechcook’s picture

Applied to latest 6.x-1.2

indytechcook’s picture

Status: Reviewed & tested by the community » Fixed

This is part of the latest DEV. Please test.

Status: Fixed » Closed (fixed)

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