Closed (fixed)
Project:
Taxonomy Block
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
30 Jan 2006 at 13:35 UTC
Updated:
15 Feb 2006 at 12:30 UTC
Jump to comment: Most recent file
It appears that if I select a vocabulary id when configuring my block I will not get all node items listed correctly.
This appears to be caused by the vocab id (vid) being passed to the taxonomy_get_children() as both the vid AND the tid value. So I only ever see nodes which have a term id = vocab id.
Looking through the taxonomy.module there doesn't appear to be a documented way to obtain all term ids belonging to a vocabulary id.
The following code will obtain all the term ids and put them in an array.
// Get terms in this vocabulary
$result = db_query('SELECT t.* FROM {term_hierarchy} h, {term_data} t WHERE t.vid = %d AND h.tid = t.tid ORDER BY weight, name', $vid);
$tids = array();
while ($term = db_fetch_object($result)) {
$tids[] = $term->tid;
}
Maybe it can be used somewhere in the taxonomy_block.module ?
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | vocab.patch | 825 bytes | budda |
Comments
Comment #1
buddaFix wasn't so difficult after all.
Tested with a vocabulary and child terms, and a vocab with a multiple hierarchy of terms.
Results as expected.
I wasn't 100% clear what the point of
$tids[$result->tid] = $result->tid;was, so moved it to only be used when creating a list of child terms from a selected root term.Comment #2
buddaPatch applied yesterday.
Comment #3
(not verified) commented