Here is a patch that adds db_rewrite_sql() to quick results. This will respect the users permissions to acctually access the nodes in quick find results.
/**
* 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 = drupal_strtolower($string);
if (empty($settings['node_types'])) {
$result = db_query_range(db_rewrite_sql('SELECT title FROM {node} WHERE title LIKE "%s%%"', $string), 0, 10);
}
else {
$result = db_query_range(db_rewrite_sql('SELECT title FROM {node} WHERE type IN('. db_placeholders($settings['node_types'], 'varchar') .') AND title LIKE "%s%%"', array_merge($settings['node_types'], array($string))), 0, 10);
}
while ($node = db_fetch_object($result)) {
$matches[$node->title] = check_plain($node->title);
}
}
print drupal_to_js($matches);
exit();
}
Comments
Comment #1
derjochenmeyer commentedPatch above does not work! I didnt test the patch above before posting it. Here is a tested version that works on my installation (lots of permissions with Content Access Module).
Comment #2
derjochenmeyer commentedThis patch is identical to the one above but also adds the feature (#415244: search any part of the title (not just beginnig)) to search within any part of the node title.
Apply the patch or replace the function node_quick_find_autocomplete() in function node_quick_find.module
Comment #3
nicholasthompsonFixed in 1.2 as part of the Security Release.