mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
"Fixes #3854, Scaffolding is generating an id field with an empty value for auto_increment primary key"
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6345 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
04934fdb2f
commit
68487baf47
1 changed files with 4 additions and 0 deletions
|
@ -1172,6 +1172,10 @@ class Model extends Overloadable {
|
|||
}
|
||||
$fields = $values = array();
|
||||
|
||||
if (isset($this->data[$this->alias][$this->primaryKey]) && empty($this->data[$this->alias][$this->primaryKey])) {
|
||||
unset($this->data[$this->alias][$this->primaryKey]);
|
||||
}
|
||||
|
||||
foreach ($this->data as $n => $v) {
|
||||
if (isset($this->hasAndBelongsToMany[$n])) {
|
||||
if (isset($v[$n])) {
|
||||
|
|
Loading…
Reference in a new issue