diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-06-25 19:33:47 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-06-25 19:33:47 +0000 |
commit | 7b77b90c03f1d2a7c8aa4531c8c3e916348770ce (patch) | |
tree | 21e5850a4fc960b7ad0f3b1f1d0cd7cc45173101 /modules/system | |
parent | b54ff2c810b7bf9bc5240e8def48d9f4abd58466 (diff) | |
download | brdo-7b77b90c03f1d2a7c8aa4531c8c3e916348770ce.tar.gz brdo-7b77b90c03f1d2a7c8aa4531c8c3e916348770ce.tar.bz2 |
- Patch #795174 by Berdir: use %alias in SelectQuery joins and remove workarounds.
Diffstat (limited to 'modules/system')
-rw-r--r-- | modules/system/system.api.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php index 6101c3fe1..0a37d8951 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -2656,14 +2656,14 @@ function hook_query_TAG_alter(QueryAlterableInterface $query) { // Skip the extra joins and conditions for node admins. if (!user_access('bypass node access')) { // The node_access table has the access grants for any given node. - $access_alias = $query->join('node_access', 'na', 'na.nid = n.nid'); + $access_alias = $query->join('node_access', 'na', '%alias.nid = n.nid'); $or = db_or(); // If any grant exists for the specified user, then user has access to the node for the specified operation. foreach (node_access_grants($op, $query->getMetaData('account')) as $realm => $gids) { foreach ($gids as $gid) { $or->condition(db_and() - ->condition("{$access_alias}.gid", $gid) - ->condition("{$access_alias}.realm", $realm) + ->condition($access_alias . '.gid', $gid) + ->condition($access_alias . '.realm', $realm) ); } } @@ -2672,7 +2672,7 @@ function hook_query_TAG_alter(QueryAlterableInterface $query) { $query->condition($or); } - $query->condition("{$access_alias}.grant_$op", 1, '>='); + $query->condition($access_alias . 'grant_' . $op, 1, '>='); } } } |