Free tag terms aren't deleted from menu

aasarava - April 4, 2009 - 19:40
Project:Taxonomy Menu
Version:6.x-2.3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Thanks for the module. But I'm finding that when I delete a node with a free tag taxonomy item, the corresponding terms aren't deleted from the menu. Is this functionality not yet available? The only way I can remove the terms from the menu is to explicitly rebuild the menu from the Taxonomy Menu admin panel.

#1

indytechcook - April 4, 2009 - 23:01

It should be deleting. I thought I tested this functionality in free tagging. I'll give it a try.

Just to clarify, you have 'hide empty terms' selected and you deleting the only node attached to that tag?

What other settings do you have for taxonomy menu?

#2

aasarava - April 5, 2009 - 22:35

Correct, I have "hide empty terms" selected and I'm deleting all the nodes attached to a given tag. But the tag stays in the menu until I rebuild, at which point it's gone (as to be expected.)

In addition to "hide", I have "synchronize" and "display number of nodes" selected.

Thanks for your help.

#3

indytechcook - April 6, 2009 - 00:15

I wasn't able to reproduce it. When I had removed the tag the term disappeared. I tried to reproduce with block cache on also and it worked fine for me.

I remember hearing the another person had this issue, but I don't remember how it was resolved and I can't find the issue.

Is there anything else you can tell me that might help?

#4

aasarava - April 7, 2009 - 22:41

Hi indytechcook. I just tried it on a completely fresh install of Drupal 6.10 and Taxonomy Menu 6.x-2.3 with no other themes or contributed modules and ran into the same problem. Here are all the steps I took:

1. Installed Drupal 6.10 on a fresh database.
2. Installed Taxonomy Menu 6.x-2.3.
3. Created a new taxonomy vocabulary, called Tags.
- set it to use free tags
- applied it to type Story
- added it to the Navigation menu
- checked Sync and Hide Empty
4. Created a new Story node and assigned the tag "testing". The term "testing" showed up in the Nav menu.
5. Delete the Story node. The term did not disappear from the Nav menu.

I'm running on PHP 5.2, MySQL 5, and Apache 2.

#5

indytechcook - April 8, 2009 - 02:20

Ok. Now I've confirmed that you are not crazy... jk

The issues is with the nodeapi delete operation. I'll get it fixed tonight and a dev release will be available tomorrow.

#6

indytechcook - April 8, 2009 - 03:01
Status:active» fixed

Ok. I think I fixed it. Please download the dev version dated after this post and let me know.

Thanks,
Neil

#7

aasarava - April 8, 2009 - 16:14
Status:fixed» closed

Just tested. Works great. Thank you for the quick fix! Very much appreciated.

#8

aasarava - April 28, 2009 - 23:33
Status:closed» active

Sorry, opening this again. Just realized on further testing two seemingly related problems with free tag vocabs:

1. Upon deleting a node that has a term, the term is removed from the menu -- even if there are other nodes with that term. E.g., if you have two blog posts tagged "test", deleting one blog post will remove the "test (2)" from the menu item altogether.

2. There seems to be an intermittent problem where the terms are not removed from the menu even after all nodes containing the term are deleted. And now, rebuilding the menu doesn't clear them out. The only fix is to manually disable those terms from the menu itself. Will test further to see if I can come up with clear steps to reproduce.

In the meantime, any thoughts on the first issue here? Thanks!

#9

aasarava - April 29, 2009 - 00:06

Ok, here's what I found out by problem #2 above where sometimes you get terms that can't be removed from the menu, even with a rebuild. I can recreate this if:

1. I add two new nodes, each with the same term ("test").
2. Then I delete one of the nodes. (The problem #1 above should kick in where the entire term is removed from the menu, even though one node is still around.)
3. Then I create a new node with the same term ("test"). The term shows up in the menu again and notes that 2 nodes are in it. That's correct behavior.
4. Then I create a fourth node, again with the same term. This time, instead of showing 3 nodes in the term, a new menu item is created. So I've got: "test (2)" and "test (3)" in the menu.
5. Delete the fourth node. The menu items remain unchanged.

Hope that helps. Thoughts? Thanks.

#10

indytechcook - August 30, 2009 - 02:07
Status:active» fixed

Added to 2.4-beta1.

#11

System Message - September 13, 2009 - 02:10
Status:fixed» closed

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

#12

derekframpton - December 13, 2009 - 04:44
Status:closed» needs review

Hello,

I'm reopening this ticket because it seems closest to the problem that I am encountering with free tagging. I am not sure of the explicit functionality, but I am finding that when I enter free tags, and then delete them, they will update within the data field within the search_dataset table.

However, when I delete them from the free tagging field that I have created their row remains within the term_node table and the linkage between the nid field and tid field is still present. Since there is no corresponding distinct value within the node table, I am not able to query out these rows and delete them. I have come across this problem while attempting to create tag clouds that update based upon the updating of tags, but I have found that I must manually remove the rows that correspond to an nid based on the tid linkage because they are not deleted when the term no longer exists within the free tagging text field.

I am not sure if this is helpful in defining the relationship in question, but if the menu function discussed above is based upon the same relationships, then it would make sense that the tag would no longer become searchable (since running cron updates the data field in search_dataset table) but the item still appears in menu if it is based upon the nid linkage to tid within the term_node and term_data tables.

I have looked at the tables to see if I might find a distinct key field where I might delete the no longer active tid to nid relationships, but have not been able to find one, and do not wish to add to the core tables since it would most likely impact future upgrades. If there is some workaround that anyone might think of, then please post.

#13

indytechcook - December 13, 2009 - 13:13
Status:needs review» closed

Hello derekframpton,

This issue was about menu items created by taxonomy menu that are related to free tag vocabularies were not being updated/delete when a node containing the related vocabulary is delete.

Your issue really has nothing to do with Taxonomy Menu. This issue is attached to the taxonomy menu contributed module.

It sounds like your issue is related to core search. You should either make a post in the forums or log in issue against core here.

 
 

Drupal is a registered trademark of Dries Buytaert.