Download & Extend

Restricts all node listings, not just search?

Project:Search Restrict
Version:6.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hi Robert,

This module looks a very quick and easy way of controlling search behaviour. :-)

One thought - since it is using http://api.drupal.org/api/function/hook_db_rewrite_sql/6, presumably this means that it will affect all node listings generated by core (or by contrib if they use db_rewrite_sql(), which I guess Views doesn't).

In practice I guess this won't be a problem, though in theory you might have a content admin you wanted to be able to see stuff listed at admin/content/node while not having the same stuff show up in search results.

Comments

#1

Status:active» fixed

No, it only affects search queries.

#2

Status:fixed» closed (fixed)

#3

Version:5.x-1.x-dev» 6.x-1.x-dev

Ah I get it, the clue is in function search_restrict_db_rewrite_sql() at http://drupalcode.org/viewvc/drupal/contributions/modules/search_restric...

if ($query == '' ...

The only time hook_db_rewrite_sql() http://api.drupal.org/api/function/hook_db_rewrite_sql/6 is invoked with an empty $query is in http://api.drupal.org/api/function/node_search/6 case $op == 'search'. Handy!

nobody click here