mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Fixing bug when primaryKey is not id. Fixes #5615.
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7757 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
24949e30e0
commit
e3fb56f6be
1 changed files with 1 additions and 1 deletions
|
@ -582,7 +582,7 @@ class TreeBehavior extends ModelBehavior {
|
|||
}
|
||||
$count = 1;
|
||||
foreach ($model->find('all', array('conditions' => $scope, 'fields' => array($model->primaryKey), 'order' => $left)) as $array) {
|
||||
$model->{$model->primaryKey} = $array[$model->alias][$model->primaryKey];
|
||||
$model->id = $array[$model->alias][$model->primaryKey];
|
||||
$lft = $count++;
|
||||
$rght = $count++;
|
||||
$model->save(array($left => $lft, $right => $rght), array('callbacks' => false));
|
||||
|
|
Loading…
Add table
Reference in a new issue