From 04934fdb2fa8b4079a85ccd4792b9f9bfc7fd4ff Mon Sep 17 00:00:00 2001 From: phpnut Date: Wed, 9 Jan 2008 01:06:45 +0000 Subject: [PATCH] Reverting [6249] and [6250] this commit broke the working implementation. Closes #3810 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6344 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/model/model.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 9d0329a70..fd2bcef57 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -1948,21 +1948,20 @@ class Model extends Overloadable { * * @param array $data Results of find operation * @param string $root NULL or id for root node of operation - * @param integer $index last processed index of $data * @return array Threaded results * @access private * @see Model::findAllThreaded() */ - function __doThread($data, $root, $index = 0) { + function __doThread($data, $root) { $out = array(); $sizeOf = sizeof($data); - for ($ii = $index; $ii < $sizeOf; $ii++) { + for ($ii = 0; $ii < $sizeOf; $ii++) { if (($data[$ii][$this->alias]['parent_id'] == $root) || (($root === null) && ($data[$ii][$this->alias]['parent_id'] == '0'))) { $tmp = $data[$ii]; if (isset($data[$ii][$this->alias][$this->primaryKey])) { - $tmp['children'] = $this->__doThread($data, $data[$ii][$this->alias][$this->primaryKey], $ii); + $tmp['children'] = $this->__doThread($data, $data[$ii][$this->alias][$this->primaryKey]); } else { $tmp['children'] = null; }