I just attempted to merge two terms on one of my websites (never did it before) with Taxonomy Manager and immediately after doing so, the node count for all of the terms in that vocabulary became 0. I was able to rebuild the term node counts by manually running a couple queries (based on the term_node_count installation file).

As far as I know, Taxonomy Manager shouldn't have touched the term_node_count table, so I think it's likely a bug in this module. I should note that when I was merging the two terms, I checked all 3 boxes in the final step (I think it had to do with child terms, parent terms, and synonyms or something).

Comments

archard’s picture

Status: Active » Postponed (maintainer needs more info)

I'll take a look at Taxonomy Manager and see where the problem lies. What version of that module are you using?

By the way, you can always restore node counts to their proper values by completely uninstalling and reinstalling the module.

preventingchaos’s picture

I'm using:
Term Node Count 6.x-1.2
Taxonomy Manager 6.x-1.0-beta2

At the time I wasn't sure if there would be any side-effects with reinstalling the module, but I suppose that it makes sense that I should be able to.

clintthayer’s picture

I just had my counts reset... I just edited the vocab and it seems to have reset... anyway that I can get it back?

archard’s picture

Completely uninstall and reinstall the module, meaning disable it then click the uninstall tab.

You're using Taxonomy Manager as well right?

archard’s picture

Status: Postponed (maintainer needs more info) » Fixed

I found out that the problem was caused by a missing break in the switch statement of Term Node Count's taxonomy hook. The issue is fixed in the latest release (1.3). However, Taxonomy Manager does not provide a notification for other modules when a term gets merged. So your data will no longer get corrupted, but the resulting term will always have a 0 node count until you update any node that's attached to that term. I would talk to the Taxonomy Manager maintainer and ask to put in a hook that lets other modules know when terms are merged.

Status: Fixed » Closed (fixed)

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

giorgio79’s picture

Thanks Archard, I am having the same issue with taxonomy manager. Thanks for this explanation.

dankohn’s picture

Archard, if it's a couple line fix, would you please be willing to post the patch here that would enable Taxonomy Manager to interact correctly with term node count?

I've also posted a link to this bug here: http://drupal.org/node/600160

dankohn’s picture

For those who have their data corrupted by a lot of editing, I recommend installing drush, and then issuing the following command to rebuild the table from scratch. It would be nice to have a rebuild option under admin tools:

drush -y disable term_node_count; drush -y uninstall term_node_count; drush -y enable term_node_count