Enforce access rules does not work on search pages
agentrickard - November 5, 2009 - 15:29
| Project: | Domain Access |
| Version: | 6.x-2.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
In the db_rewrite_sql we have this code:
<?php
// In any of the following cases, do not enforce any rules.
if (!$admin_force || empty($query) || $primary_field != 'nid' || !user_access('administer nodes') || domain_grant_all()) {
return;
}
?>The empty($query) was a safeguard against, well, empty queries, but node searching invokes db_rewrite_sql() without passing a $query, so we have to remove that if searching is to work properly.
Testing needed to see if this introduces any errors.

#1
Patch for D5.
#2
D6 version.
#3
Committed to D6 and HEAD.
#4
Committed to D5.
#5
Automatically closed -- issue fixed for 2 weeks with no activity.