Browse Source

fix for generateList

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4065 3807eeeb-6ff5-0310-8944-8be069107fe0
gwoo 19 years ago
parent
commit
ecb2b8c786
1 changed files with 7 additions and 0 deletions
  1. 7 0
      cake/libs/model/model.php

+ 7 - 0
cake/libs/model/model.php

@@ -1610,6 +1610,10 @@ class Model extends Overloadable {
 		}
 		$result = $this->findAll($conditions, $fields, $order, $limit);
 		$this->recursive = $recursive;
+		
+		if(!$result) {
+			return false;
+		}
 
 		if ($keyPath == null) {
 			$keyPath = '{n}.' . $this->name . '.' . $this->primaryKey;
@@ -1630,6 +1634,9 @@ class Model extends Overloadable {
 				if (!empty($group)) {
 					$c = count($keys);
 					for ($i = 0; $i < $c; $i++) {
+						if(!isset($group[$i])) {
+							$group[$i] = 0;
+						}
 						if (!isset($out[$group[$i]])) {
 							$out[$group[$i]] = array();
 						}