Closed (fixed)
Project:
Web Links
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Mar 2011 at 22:46 UTC
Updated:
26 Nov 2015 at 17:38 UTC
Jump to comment: Most recent
I found a error on weblinks.module about line 794
taxonomy_term_count_nodes don't exist on Drupal 7
I try to replace:
$term->node_count = taxonomy_term_count_nodes($tid, 'weblinks');
by:
$term->node_count = db_query("SELECT COUNT(ti.nid) FROM {taxonomy_index} as ti INNER JOIN {node} as n on n.nid=ti.nid WHERE ti.tid = :aid and n.type='weblink'", array(':aid' => $tid) )->fetchField();
Comments
Comment #1
GStegemann commentedThanks.
This issue has been fixed in the current D7 development version.
Comment #3
kumkum29 commentedHello,
is there a function to replace taxonomy_term_count_nodes in Drupal 7?
I have not found an alternative.
Thanks.
Comment #4
GStegemann commentedNo, not really.
But I've written a replacement function in Web Links:
Comment #5
leopathu commentedDrupal 7 has another equivalent api to get taxonomy term's nodes. here is the api https://api.drupal.org/api/drupal/modules!taxonomy!taxonomy.module/funct...
It will return array value, we could count the array values with php.
Comment #6
fox mulder commentedI think taxonomy_select_nodes() is OK, but you must pay attention the second $pager param that is defaultly TRUE ( in my case this limited the result of count() function to 10 ) The correct code is:
See: https://api.drupal.org/comment/55993#comment-55993