Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix notice errors with postgres.

  • Loading branch information...
commit 8d1b5c3f248c42701e57f157a3973590de63391d 1 parent 15c94de
@markstory markstory authored
Showing with 7 additions and 7 deletions.
  1. +7 −7 lib/Cake/Model/Model.php
View
14 lib/Cake/Model/Model.php
@@ -2874,7 +2874,7 @@ protected function _findNeighbors($state, $query, $results = array()) {
$return = array();
if (isset($results[0])) {
$prevVal = Hash::get($results[0], $field);
- $query['conditions'][$field . ' >='] = $prevVal[0];
+ $query['conditions'][$field . ' >='] = $prevVal;
$query['conditions'][$field . ' !='] = $value;
$query['limit'] = 2;
} else {
@@ -2883,14 +2883,14 @@ protected function _findNeighbors($state, $query, $results = array()) {
$query['limit'] = 1;
}
$query['order'] = $field . ' ASC';
- $return2 = $this->find('all', $query);
+ $neighbors = $this->find('all', $query);
if (!array_key_exists('prev', $return)) {
- $return['prev'] = $return2[0];
+ $return['prev'] = $neighbors[0];
}
- if (count($return2) === 2) {
- $return['next'] = $return2[1];
- } elseif (count($return2) === 1 && !$return['prev']) {
- $return['next'] = $return2[0];
+ if (count($neighbors) === 2) {
+ $return['next'] = $neighbors[1];
+ } elseif (count($neighbors) === 1 && !$return['prev']) {
+ $return['next'] = $neighbors[0];
} else {
$return['next'] = null;
}
Please sign in to comment.
Something went wrong with that request. Please try again.