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
Comment #1
archard commentedI'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.
Comment #2
preventingchaos commentedI'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.
Comment #3
clintthayer commentedI just had my counts reset... I just edited the vocab and it seems to have reset... anyway that I can get it back?
Comment #4
archard commentedCompletely uninstall and reinstall the module, meaning disable it then click the uninstall tab.
You're using Taxonomy Manager as well right?
Comment #5
archard commentedI 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.
Comment #7
giorgio79 commentedThanks Archard, I am having the same issue with taxonomy manager. Thanks for this explanation.
Comment #8
dankohn commentedArchard, 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
Comment #9
dankohn commentedFor 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