diff --git a/cake/libs/controller/components/dbacl/models/aclnode.php b/cake/libs/controller/components/dbacl/models/aclnode.php index 546f1ec79..e45d26886 100644 --- a/cake/libs/controller/components/dbacl/models/aclnode.php +++ b/cake/libs/controller/components/dbacl/models/aclnode.php @@ -86,7 +86,7 @@ class AclNode extends AppModel { $query .= "ON {$type}{$k}.lft > {$type}{$i}.lft && {$type}{$k}.rght < {$type}{$i}.rght "; $query .= "AND {$type}{$k}.alias = " . $db->value($alias) . " "; } - $result = $this->query("{$query} WHERE {$type}.lft <= {$type}0.lft AND {$type}.rght >= {$type}0.rght ORDER BY {$type}.lft DESC"); + $result = $this->query("{$query} WHERE {$type}.lft <= {$type}0.lft AND {$type}.rght >= {$type}0.rght ORDER BY {$type}.lft DESC", $this->cacheQueries); } elseif (is_object($ref) && is_a($ref, 'Model')) { $ref = array('model' => $ref->name, 'foreign_key' => $ref->id); } elseif (is_array($ref) && !(isset($ref['model']) && isset($ref['foreign_key']))) { @@ -123,7 +123,7 @@ class AclNode extends AppModel { $query = "SELECT {$type}.* From {$prefix}{$table} AS {$type} "; $query .= "LEFT JOIN {$prefix}{$table} AS {$type}0 "; $query .= "ON {$type}.lft <= {$type}0.lft AND {$type}.rght >= {$type}0.rght "; - $result = $this->query("{$query} " . $db->conditions($ref) ." ORDER BY {$type}.lft DESC"); + $result = $this->query("{$query} " . $db->conditions($ref) ." ORDER BY {$type}.lft DESC", $this->cacheQueries); if (!$result) { pr($this->trace()); diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 197f6b90d..e0ef12128 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -246,6 +246,9 @@ class DboSource extends DataSource { return $args[2]->find($query, $fields, $order, $recursive); } } else { + if(isset($args[1]) && $args[1] === true){ + return $this->fetchAll($args[0], true); + } return $this->fetchAll($args[0], false); } }