Node Count not updating

Mistercrash - November 3, 2009 - 22:37
Project:Taxonomy Menu
Version:6.x-2.4-beta3
Component:Miscellaneous
Category:bug report
Priority:critical
Assigned:Unassigned
Status:fixed
Description

I'm having some trouble with taxonomy menu not rebuilding when I create a new node. This results in the "Display number of items" option not updating. I can only rebuild the menu manually. This is not the case with Taxonomy Menu version 2.4 beta1.

Does anybody have an idea how I can have it automaticly rebuild whenever I create a new node that has a taxonomy term from the menu attached? Like it did before...

#1

Mistercrash - November 4, 2009 - 09:38
Assigned to:Mistercrash» Anonymous

I tried out 2.3 Stable version and adding nodes does rebuild the menu but deleting nodes doesn't....

#2

indytechcook - November 4, 2009 - 20:13
Category:support request» bug report

Setting to bug and investigating. There was a change done to limit the amount of work done after each node update.

#3

indytechcook - November 4, 2009 - 22:25

I've confirmed this bug and know where it is. I'm fixing it now.

#4

indytechcook - November 5, 2009 - 01:52
Status:active» fixed

The change has been committed and will be part of latest dev.

#5

Mistercrash - November 5, 2009 - 14:55
Status:fixed» needs review

I'm having some issues with the new dev. Runnin it from school right now, but will try this again at home. Might be just me.
It deletes the node, but still doesn't change the node count and trows these 2 errors at me.

recoverable fatal error: Object of class stdClass could not be converted to string in C:\xampp\htdocs\drupal.local\sites\all\modules\taxonomy_menu\taxonomy_menu.database.inc on line 160.

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT vid FROM term_data WHERE tid in () in C:\xampp\htdocs\drupal.local\sites\all\modules\taxonomy_menu\taxonomy_menu.database.inc on line 161.

Greetz Alex.

#6

indytechcook - November 5, 2009 - 16:04
Title:Taxonomy menu not rebuilding after node creation.» Node Count not updating
Status:needs review» fixed

Hello Alex,

The issue was that the delete operation in nodeapi was sending the node->taxonomy array differently then the other operations. I fixed this issue.

I did a little more testing this time and it looks good. Look for the latest dev and new package soon.

#7

Mistercrash - November 6, 2009 - 08:24
Status:fixed» needs work

Sorry to keep bothering you with this, but it's not there yet. On the contrary I think you need to take a few steps back because it's going in the wrong direction. The error messages are gone but,

i've got several new issues:
- deleting multiple nodes with the same term causes only one term making a -1 in the (node counter).
- deleting multiple nodes with different terms cause again only one term making a -1 in the (node counter).
- deleting the whole vocabulary causes all node counters to dissapear but the menu still remains in the taxonomy_menu table.
- when creating a new vocabulary for the menu it adds the new menu to the old one.
- welll.....after that it's about all screwed. Adding nodes doesn't add count's, deleting is still the same.

What I'm thinking here is that you are trying too hard with the delete op to make the array correct.
Maybe it's not a bad idea to call the whole rebuild function of the rebuild check box of the interface settings.
Because that one always made the correct changes.

Again I'm just guessing here, im not a php expert (yet:-) so have a hard time figuring out the code.
I just have the feeling it's becoming a worse problem. Hope I'm not stressing you out with this bug.
I will gladly keep testing your changes cause I'm pretty keen on your menu.

#8

matteoraggi - November 11, 2009 - 21:01

I confirm deleting a node then the count remain the same of past, instead adding is ok using the 2.3 stable.

#9

kratib - November 14, 2009 - 09:31

subscribe

#10

indytechcook - November 19, 2009 - 18:21
Priority:normal» critical

Sorry I've been MIA. Uping priority to get me to work on it;

#11

indytechcook - November 19, 2009 - 18:49

Note about calling the rebuild function: It's can be pretty recourse intensive. Not something you can to run after each node delete. Thanks for the info. I'll keep digging.

#12

indytechcook - November 19, 2009 - 20:29

deleting the whole vocabulary causes all node counters to dissapear but the menu still remains in the taxonomy_menu table.

Fixed this here: http://drupal.org/cvs?commit=291396 will be in the latest dev within 12 hours.

Still working on the others.

#13

fred0 - November 20, 2009 - 08:15

I'm seeing this error twice on node saves:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key,3)' at line 1 query: SELECT vid FROM term_data WHERE tid in (key,3) in /var/www/vhosts/hughjaas.com/subdomains/btp/httpdocs/sites/default/modules/taxonomy_menu/taxonomy_menu.database.inc on line 162.

#14

indytechcook - November 20, 2009 - 18:37

I made a change that should help. I haven't had a chance to test it yet. The dev should be updated within the next 12 hours.

#15

fred0 - November 22, 2009 - 21:36

My error persists after Nov 21 dev update.

#16

hass - November 24, 2009 - 00:19

I also do have this issue with 6.x-2.4-beta3! This is really bad as I've made this upgrade to get rid of rebuilding failures solved in beta2 with #539046: Use Batch API to regenerate menu. Any chance to get this bug fixed soon?

#17

indytechcook - November 24, 2009 - 01:15

@fred0 & @hass the node save issue is being tracker here: #641068: Error on node save when using Content Taxonomy. In the future, please be sure to open new issues for unrelated items. This issue is for an error on node count.

On a side note. I am unable to reproduce the erorr. Please post the instructions about how to reproduce the issue here: #641068: Error on node save when using Content Taxonomy.

#18

indytechcook - November 24, 2009 - 13:59

I found where the issue is with multiple nodes. I'm working on it and should have a fix today.

#19

hass - November 24, 2009 - 14:51

Only as a note - I have the Node Count not updating issue, not the Error on node_save(). Looking forward to test the patch.

#20

indytechcook - November 24, 2009 - 14:56

lol. So many issue, so little time. Thanks for the info hass. This issue became confused by poor fred0 :)

Here is a patch. Since I haven't tested it AT ALL, i am just including the patch and not committing. Make sure you apply the patch to the latest DEV and not BETA3 if you have time to test, clear caches, rebuild the taxonomy menu, etc ;)

I'll get to testing after work tonight.

Cheers,
Neil

AttachmentSize
taxonomy_menu-622516.patch 2.65 KB

#21

kratib - November 24, 2009 - 22:39

The latest patch did not update the node count and gave me the following error:

user warning: Unknown column 'tags' in 'where clause' query: SELECT vid FROM term_data WHERE tid in (1,tags) in /var/www/thereisamoduleforthat/sites/all/modules/taxonomy_menu/taxonomy_menu.database.inc on line 162.

#22

matteoraggi - November 25, 2009 - 00:39

I confirm, als ofor me the problem is only with multiple nodes, here http://www.wyposazeniehoteli.com/ without multiple selection enabled, I have addded the Horeca therm and all is ok, instead on taxonmy with multislection activated it give problems, yes, using the last old stable version not beta 2.3.

#23

indytechcook - November 25, 2009 - 01:48
Status:needs work» needs review

Thanks for you patience. I was tyring to implement a new check that doesn't seem to be worth the effort. I backed out some of my changes and and it seems to be working much better. I took @hass's advice of KISS :)

Check against the DEV version in the next 12 hours or against the DRUPAL--6-2 branch. Once I heard the word, I will create a new release.

#24

hass - November 25, 2009 - 08:08

Could one of you explain a bit what you mean with "multiple" nodes? I'm only executing node_save() nothing else… node by node. (import script)

#25

matteoraggi - November 25, 2009 - 14:42

Sorry for my mistake, with "multiple nodes" (copyed from here: http://drupal.org/node/622516#comment-2301046) I mean:
Multiple select
Allows posts to have more than one term from this vocabulary (always true for tags).

#26

indytechcook - November 25, 2009 - 14:46

Have you tried the latest dev yet? I made an update last night.

#27

hass - November 25, 2009 - 17:06

Not yet - limited time... hopefully tonight :-)

#28

kratib - November 25, 2009 - 22:22

Using the latest dev, the node count was successfully updated upon both node creation and deletion. Thanks.

#29

matteoraggi - November 26, 2009 - 03:01

I have tested .dev on a non multiple select and it is ok as first, and then I tested it on a multiple select ( grey nice_menu on the left http://www.forniture-alberghiere.net ) and it is ok! Just it don't appear into alfabetical order, but at least it is showed without need anytime my handwork.

#30

hass - November 26, 2009 - 08:46

#31

indytechcook - November 26, 2009 - 13:55
Status:needs review» fixed

Setting to Fixed. :)

@matteoraggi other issue will be tracked #641036: Items not correctly orderd by alphabet

 
 

Drupal is a registered trademark of Dries Buytaert.