function _yahoo_terms_vocab_select doesnt recognize category module

senthiln - September 17, 2007 - 09:26
Project:Yahoo Terms
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

_yahoo_terms_vocab_select in yahoo_terms module uses the following line of code

if ($type == NULL) {
$vocabularies = db_query("SELECT v.vid, v.name FROM {vocabulary} v WHERE module='taxonomy' ");
}
else {
$vocabularies = db_query("SELECT v.vid, v.name FROM {vocabulary} v LEFT JOIN {vocabulary_node_types} vt ON v.vid = vt.vid WHERE module='taxonomy' AND vt.type = '%s'", $type);
}

it must be changed to

if ($type == NULL) {
$vocabularies = db_query("SELECT v.vid, v.name FROM {vocabulary} v WHERE module='taxonomy' OR module='category'");
}
else {
$vocabularies = db_query("SELECT v.vid, v.name FROM {vocabulary} v LEFT JOIN {vocabulary_node_types} vt ON v.vid = vt.vid WHERE module='taxonomy' OR module='category' AND vt.type = '%s'", $type);
}

support the cateogry and category wrapper modules. This change is required because category module replaces taxonomy module with its own wrapper.

 
 

Drupal is a registered trademark of Dries Buytaert.