Wrong node count in Catalog block when using Catalog vocabulary for other types

Project: 
Ubercart
Category: 
bug report
Version: 
Ubercart 1.0 RC
Priority: 
normal
Assigned: 
Unassigned
Status: 
active

I have using Catalog vocabulary linking for e-shop nodes ('product' node type) and for another nodes (for example, 'story' node type).
And count of nodes in terms, that have 'story' nodes shows wrong: must be showed only 'product' nodes, but shows count of 'product' + 'story' nodes. This is because wrong function used: uc_catalog.module, line 1290

<?php
  $num
= taxonomy_term_count_nodes($branch->tid);
?>

But in catalog pages node counts normally, because in this place node counts by types:
uc_catalog.module, lines from 843

<?php
     
foreach ($types as $type) {
       
$g_child_nodes += taxonomy_term_count_nodes($grandchild->tid, $type);
      }
?>

Maybe using the easier count method in block is done for performance reason, but maybe this is a mistake. But in my site this issue shows wrong info for visitors.

Will this issue be solved in future versions or not?

P.S. Sorry for my English.

Re: Wrong node count in Catalog block when using Catalog vocabul

Since you pointed it out, it seems like such a good idea, I don't know why it wasn't done that way in the first place. taxonomy_term_count_nodes() caches its results so it is not a problem to get the same results several times on the page.

So, yes, it will be changed in future versions. I'd like to hear if anybody notices any performance issues, because I thought it had been changed before. But now I don't expect there to be any.