mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Adding fix for #2522, fixes errors when primary key is not auto increment and the primary key is set in the data to be saved.
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4995 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
137fea94c6
commit
0bdb6d7e1d
1 changed files with 0 additions and 7 deletions
|
@ -1039,8 +1039,6 @@ class Model extends Overloadable {
|
|||
$weHaveMulti = false;
|
||||
}
|
||||
|
||||
$newID = null;
|
||||
|
||||
foreach($this->data as $n => $v) {
|
||||
if (isset($weHaveMulti) && isset($v[$n]) && $count > 0 && count($this->hasAndBelongsToMany) > 0) {
|
||||
$joined[] = $v;
|
||||
|
@ -1056,10 +1054,6 @@ class Model extends Overloadable {
|
|||
if ($this->hasField($x) && ($whitelist && in_array($x, $fieldList) || !$whitelist)) {
|
||||
$fields[] = $x;
|
||||
$values[] = $y;
|
||||
|
||||
if ($x == $this->primaryKey && !empty($y)) {
|
||||
$newID = $y;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1103,7 +1097,6 @@ class Model extends Overloadable {
|
|||
foreach ($this->belongsTo as $parent => $assoc) {
|
||||
if (isset($assoc['counterCache']) && !empty($assoc['counterCache'])) {
|
||||
$parentObj =& $this->{$assoc['className']};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue