Download & Extend

Can't delete "Stray Menu Items" after deleting taxonomy vocabulary

Project:Taxonomy menu
Version:7.x-1.2
Component:Miscellaneous
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active

Issue Summary

Issue:

-Deleting a vocabulary and its terms leaves stray menu items that cannot be deleted.
-Stray menu items after vocabulary deletion
-Taxonomy menu item deletion sequence if not followed correctly leaves stray menu items.

Setup:

From within the taxonomy module:
1.- Create a vocabulary named "Test" using taxonomy.
2.- Assign the vocabulary to a menu (ie., Secondary links)

Now the vocabulary appears on the secondary links and also in the menu module administration.
the secondary link list shows the taxonomy menu items without the delete option as expected.

3.- go back to the taxonomy module and delete the vocabulary "Test"

The vocabulary is deleted from the taxonomy vocabulary list as expected.

4.- The "Secondary Links" menu now has stray items that cannot be deleted unless removed from the database table itself.

Additional note:

The only way to properly remove the links from a taxonomy menu is follow this sequence:
1.- disable the "taxonomy menu" option from within the vocabulary edit mode.
2.- Save these options.
3.- Go to the taxonomy vocabulary list and then delete the vocabulary.

The issue here is that if you forget to do these three steps you may end up with several stray links. Furthermore, these links can only be deleted via direct manipulation to the database table and not from the Drupal administrative UI.

Thanks for your prompt attention. If you need additional information just send me a note.

Sandro

Comments

#1

Thanks Sandro. We'll take a look.

Side Note: If you wish to remove all menu links created by Taxonomy Menu, you can uninstall the module.

#2

Hi and thanks for the reply.

I tried to remove the menu links by uninstalling the module but the menu items remained strayed. However, I don't remember if I cleared the cache or not. If am not mistaken, the menu links remain if the vocabulary taxonomy menu option is not disabled before deleting the whole vocabulary. After that you end up with stray items.

Oh yes I remember now.... if you disable the taxomony menu module as you suggested, the stray links go away from the Adminstration UI. However if you go and look at the database table you will see the stray data there. Once the taxonomy menu module is activated again the strays reappear.

This is an issue because you may have more than one taxonomy menu. Disabling the module is not the best approach if you want to keep one of the taxonomy menus.

Another issue is the fact that the database starts to collect stray data.

Let me know if I can be of assistance.

Best regards,

Sandro

#3

I'm having exactly this problem. In my case I'm testing site structure with Devel so the problem is exacerbated quickly. I've tried the uninstall technique above and also found that the database continues to store the stray data.

I'm using Devel Generate and Taxonomy Menu to create dropdown primary links for testing purposes (in preparation for a complex taxonomy structure). When I change the taxonomy content that originally built the menus and tell Devel to delete any previous nodes, the content is deleted but the primary menus remain with no data. There's also no way to delete the taxonomy-generated menu items, unlike the ones created by hand. A mass delete function for menus items would be ideal, and I'm feeling silly for not finding one.

One unsuccessful workaround was to move all stray or null menus under one real menu item, then to migrate it to a secondary link while checking "Select to rebuild the menu on submit." That breaks apart the null menu items from the functional one (so it recognizes the real node and moves it properly), but I'm still left with the stray primary menu items that can't be deleted.

CORRECTION:

Apologies. I've discovered that using the uninstall function in the Plugin Manager does not remove the stray items as stated, but using the built-in uninstall function on the module page does in fact clear them!

I would still like to find a quick and clean way of deleting these stray items, and some kind of check box for individual items would be ideal.

Thanks for any help with this!

#4

Great, I'm glad you figured some stuff out.

If you selected the rebuild option, then it deletes all of the current menu items created for taxonomy menu and that vocab, then recreates them.

You are correct in the statement that it didn't used to delete the menu items. That has been correct. #472004: Erros on term deletion and http://drupal.org/cvs?commit=218914

#5

Category:bug report» support request
Priority:critical» normal

How do you get to the built-in uninstall option?

#6

Category:support request» bug report
Priority:normal» critical

oops, sorry about status change.

Again, I can't figure out how to access the module's built-in uninstall function.

#7

Status:active» fixed

The uninstall is not part of taxonomy menu but part of drupal. You should also uninstall modules if you are done with them.

Go to: admin/build/modules/uninstall

#8

I believe that I've run across this issue, but in may case I only want the taxonomy menu to keep pace with the vocabulary itself as terms are deleted.

i.e. if a term is deleted from the vocabulary, should I expect the menu item to be deleted at the same time?

#9

Status:fixed» closed (fixed)

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

#10

I am having this same problem and am unsure of what exactly need to be done to fix. I had taxonomy terms with Primary link menu affiliations. I deleted the tax terms and now cannot get rid of the menu terms. I have disabled and uninstalled the tax term module and yes the menu items do go away, but when i re-install the terms come back. I cannot seem to find what table needs to be cleared to start from scratch.

Any help would be great,

Dave

#11

I'm still having this with Taxonomy Menu 6.x-2.8.

I believe it happens when I add a vocab item and then delete it, and it's stuck in the menu system with no ability to delete it. I can actually move it to menus that aren't handled by Taxonomy Menu at all, but I still can't delete them.

When I uninstall Taxonomy Menu, the term disappears, even if it's not in a menu that was managed by TM.

Anyway, wasn't sure whether to reopen this or start a new issue and decided to mention it here and see if you have any questions that might help you debug (also, this is a dev site that is not live, but is running on a public server but password protected, so I could actually give you access to it and you could play around if that would help).

#12

Version:6.x-2.3» 6.x-2.8
Status:closed (fixed)» active

I'm changing the version and status since this is still happening for me with:

drupal 6.17
Taxonomy Menu 2.8

I'm still not able to figure out exactly when this is happening, but TM is still leaving stray terms in the menu even after rebuild.

It's leaving an entry in the menu_links table but there's no corresponding mlid in the taxonomy_menu table. In the menu_links table, the module column does identify it as a taxonomy_menu menu item.

Anyway, if anyone has any ideas how to stop this from happening, that would be great.

If anyone has any ideas on debugging, that would be great too.

#13

Status:active» fixed

The stray items issues have been fixed in the latest dev version. There will be a new stable soon.

#14

Thanks... and sorry to reopen. I thought 2.8 already included the fix.

I'll install the dev version and if I see any more stray items, I'll report back.

This module is a godsend. Can't live without it, so I definitely appreciate all the efforts at making it top notch!

#15

Status:fixed» closed (fixed)

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

#16

Status:closed (fixed)» active

I created a taxonomy menu from a structured, multi-parental 230 terms taxonomy.
(note: I have another TM based on a similar taxonomy that works quite well)

This led to a total mess with all multi-parent items at the root of the selected menu.
No way to get them out, even with the latest dev.

What to do?

#17

Status:active» closed (fixed)

@jvielle, terms with multiple parents are currently not supported: see #498182: Support for a term with multiple parents

I looks like you had a fixed at one time. It would be a huge help for you to roll a patch against the latest so it can be tested and included.

I'm re-closing this issue and keeping the multi term issue open.

#18

Version:6.x-2.8» 6.x-2.x-dev
Status:closed (fixed)» active

Sorry to reopen this, but I can confirm this is still an issue.

I was running version 2.9 when it started happening.

Per reply #13, I updated to the latest dev version and rebuilt my menus - the orphaned items are still there. As per other users, the only way to get rid of the item was to manually edit the database.

I reinstalled Drupal, installed the dev version, and after a few days of working it happened again.

I cannot recreate the issue exactly, but I have an idea what it may be related to. I have been experimenting with 'add item for vocabulary' The issue happens after experimenting with different menu path types (heirarcy, default, etc) and rebuilding menus based on the different configurations.

Something that may be of importance - All of my orphaned items are the lingering 'add item for vocabulary' entries. I've never had an actual term become orphaned.

This may be completely unrelated, but since the issue has started, I can no longer create a page in Views and specify a menu item for the page. I can configure "path" and "menu: Normal entry" and give it a parent menu, but it will not show up in the menu.

Thoughts?

Thanks,
Blue

#19

Subscribing, this issue just happened to me.

#20

You can quite easily get rid of these orphaned menu items without risky database editing:
Create a "Junk" menu, where you send all these fancy items - you have to provide them a valid path though such as "node".
You can delete the junk menu itself to send them all to hell.

#21

Nice! Thanks

#22

This does not work since they are system menus which are part of taxonomy_menu thus can't be removed with this method. I have 4 ghost menus that taxonomy_menu brings up which can't be deleted and are not shown in taxonomy_menu build. Only way is to manually edit the DB to get rid of these ghost/stray menu items.

#23

I was having exactly the same problem, I had taxonomy entries in both a Categories menu and the main menu. I disabled the taxonomy menu in the vocabulary settings and ticked Select to Rebuild, this deleted one set of menu entries. I then selected the menu that still had entries and ticked Select to Rebuild, submit. Went back in, selected disabled again, ticked Select to Rebuild and all stray menu entries are gone.

#24

I got it with #20 method: first I removed element from taxonomy and then I follow #20 instructions.

#25

editing the db usually does the trick quick

I think this is happening when you select [Add item for vocabulary] and the custom title bit - save then deselect/disable those & then save again - it leaves ghosts.

#26

Version:6.x-2.x-dev» 7.x-1.2
Component:Code» Miscellaneous

I have disabled and uninstalled Taxonomy Menu. However, whenever I click on a term that is previously linked to Taxonomy Menu, I receive an error message and a menu tab "Taxonomy term" appears in the main menu.

screenshot

I still need these terms as they are already being used by many pages.

Can someone tell me how to rectify this? I am willing to try deleting table from DB. Which table should I delete?

AttachmentSizeStatusTest resultOperations
drupal-screenshot.png15.6 KBIgnored: Check issue status.NoneNone

#27

Any help will be appreciated...

#28

I found that if I reinstall Taxonomy Menu and create a menu for those terms again, the mysterious "Taxonomy Term" menu will be gone.

But the problem is ... I want to uninstall Taxonomy Menu!

#29

I think this solution works for me...

http://drupal.org/node/1192812#comment-4621386

nobody click here