Project:Node Quick Find
Version:5.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

When using more than one node type in the filter results do not appear.

Comments

#1

Status:active» needs review

/**
* Autocomplete callback
*
* @param mixed $delta
* Provides the unqiue ID for the block provided by this module
* @param string $string
* The string to lookup
*/
function node_quick_find_autocomplete($delta = 0, $string = '') {
$settings = variable_get('node_quick_find_' . $delta, array());

$matches = array();
if ($string) {
$string = strtolower($string);
if (empty($settings['node_types'])) {
$result = db_query("SELECT title FROM {node} WHERE title LIKE '%s%%' LIMIT 10", $string);
}
else {
$place_holders = substr(str_repeat(",'%s'", count($settings['node_types'])), 1);
$arr = array_merge($settings['node_types'], array($string));
$result = db_query("SELECT title FROM {node} WHERE type IN ($place_holders) AND title LIKE '%s%%' LIMIT 10", $arr);
}
while ($node = db_fetch_object($result)) {
$matches[$node->title] = check_plain($node->title);
}
}
print drupal_to_js($matches);
exit();
}

#2

I was wondering why it did not work with more then one node type.....

#3

Thanks Steven - I'll get this committed at some point (rather busy right now).

#4

Status:needs review» closed (fixed)

This is fixed in D6... D5 is no longer supported.