Posted by Island Usurper on August 23, 2007 at 5:33pm
| Project: | Drupal core |
| Version: | 7.x-dev |
| Component: | taxonomy.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Island Usurper |
| Status: | closed (fixed) |
Issue Summary
When the query in taxonomy_term_count_nodes returns no rows, $count[$type] is never set. Therefore subsequent calls to this function for that type have to run the query again.
I don't have easy access to cvs and diff, so I'll roll a patch later today. The fix is one line before the while loop: $count[$type] = array();
Comments
#1
The long awaited patch is here at last.
#2
Updating to show that more people have noticed this bug. Duplicate issue found at #259243: Wrong cache of node count for taxonomy when count is 0 in function taxonomy_term_count_nodes()
#3
Committed to 5.x.
Applies to 6.x and HEAD, so needs to be committed there.
#4
Committed to HEAD and DRUPAL-6.
#5
Automatically closed -- issue fixed for two weeks with no activity.