Closed (fixed)
Project:
Node Auto Term [NAT]
Version:
6.x-1.1-beta3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Oct 2009 at 10:14 UTC
Updated:
10 Nov 2009 at 10:20 UTC
Hi
I've recently moved from Drupal 5 to 6 and I'm having problems getting nids using nat_get_nids function.
In Drupal 5 I used this php pseudo-code:
for certain terms I catch their tid {
array_push( $tids, $taxonomy->tid );
}
$nids = array_keys (nat_get_nids( $tids, FALSE));
...and I ended with an array of nids of "parent" nodes wich I used to create some views.
Now, in Drupal 6 I'm using a very similar code:
$tids = array_keys($terms); /*wich is different, but it's the same array:
$nat = nat_get_nids($tids);
print_r($nat);
...but something fail, the resulting array returned from nat_get_terms contains only one result. For example:
$tids = Array ([0] => 247 [1] => 252 [2] => 253)
$nat = Array ([301] => Ghosts'n goblins)
...wich correspond just to the first tid (247).
Is this a bug or is my fault?
Kind regards and thanks in advance.
Comments
Comment #1
NoRandom commentedI've found the bug is solved using the old db_query:
...so, it seems there is some kind of error in the new query. I don't know anything about mysql queries, does anyone find the error?
Comment #2
markabur commentedthis appears to be fixed in HEAD, see http://drupal.org/node/382270
Comment #3
NoRandom commentedThanks, markabur. You are right, this modification corrects the issue.