Looking at the current CVS right now for taxonomy.patch I see this hunk:
@@ -452,13 +466,17 @@
/**
* Find all terms associated to the given node.
*/
-function taxonomy_node_get_terms($nid, $key = 'tid') {
+function taxonomy_node_get_terms($nid, $key = 'tid', $access = 'view') {
static $terms;
if (!isset($terms[$nid])) {
$result = db_query('SELECT t.* FROM {term_data} t, {term_node} r WHERE r.tid = t.tid AND r.nid = %d ORDER BY weight, name', $
nid);
$terms[$nid] = array();
while ($term = db_fetch_object($result)) {
+ if (function_exists('taxonomy_access')) {
+ if (taxonomy_access($access,$term->tid))
+ $terms[$nid][$term->$key] = $term;
+ } else $terms[$nid][$term->$key] = $term;
$terms[$nid][$term->$key] = $term;
}
}
It seems that after all the hard work of doing a couple "if" statements to avoid the ssetting of $terms[... when taxonomy_access fails, $terms[... is set anyway. Shouldn't the last $terms[... line be removed like most of the other hunks in the patch?
Comments
Comment #1
pyromanfo commentedGood catch, that was it. Thanks!
Comment #2
(not verified) commented