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/node/node.module | |
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/node/node.module')
-rw-r--r-- | modules/node/node.module | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/node/node.module b/modules/node/node.module index fc75cd795..594df7241 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -3031,15 +3031,15 @@ function node_query_node_access_alter(QueryAlterableInterface $query) { if (!($table instanceof SelectQueryInterface) && $table == 'node') { // The node_access table has the access grants for any given node. - $access_alias = $query->join('node_access', 'na', "na.nid = {$nalias}.nid"); + $access_alias = $query->join('node_access', 'na', '%alias.nid = ' . $nalias . '.nid'); $or = db_or(); // If any grant exists for the specified user, then user has access // to the node for the specified operation. foreach ($grants 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) ); } } @@ -3048,7 +3048,7 @@ function node_query_node_access_alter(QueryAlterableInterface $query) { $query->condition($or); } - $query->condition("{$access_alias}.grant_$op", 1, '>='); + $query->condition($access_alias . '.grant_' . $op, 1, '>='); } } } |