Closed (fixed)
Project:
Taxonomy Navigator
Version:
5.x-1.1
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
8 Jul 2008 at 07:52 UTC
Updated:
13 Jan 2009 at 22:10 UTC
The function taxonomy_navigator_is_term_active() as it is currently
written results in calls to taxonomy_node_get_terms_by_vocabulary($nid, $vid)
for every taxonomy term in a given block in a given vocabulary as called
in taxonomy_navigator_block_content($vid);
This code:
if (arg(0) == 'node' && is_numeric(arg(1))){
$nid = arg(1);
$terms = taxonomy_node_get_terms_by_vocabulary($nid, $vid);
if (key_exists($tid, $terms)) {
return TRUE;
}
}
results in calls to taxonomy_node_get_terms_by_vocabulary() for
each term in a given vocab when viewing a node. The call only
needs to be made once per node $nid per vocab $vid.
The attached patch adds a static cache to run this query only
once.
You can explore this issue by running the query log of devel module
with a taxonomy_navigator block for a vocabulary with many terms.
| Comment | File | Size | Author |
|---|---|---|---|
| taxonomy_navigator.module.patch | 1.19 KB | jaydub |
Comments
Comment #1
nestor.mata commentedThanks jaydub,
This patch was implemented in version 5.x-1.2.
Best regards,
Nestor