mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Fixes #3140, UUID char(36) primary key double insert bug
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5625 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
7fe576f122
commit
fdc575b107
1 changed files with 1 additions and 1 deletions
|
@ -1080,7 +1080,7 @@ class Model extends Overloadable {
|
|||
} else {
|
||||
foreach ($this->_tableInfo->value as $key => $value) {
|
||||
if(in_array($this->primaryKey, $value)) {
|
||||
if($this->_tableInfo->value[$key]['type'] === 'string' && $this->_tableInfo->value[$key]['length'] === 36) {
|
||||
if (empty($this->data[$this->name][$this->primaryKey]) && $this->_tableInfo->value[$key]['type'] === 'string' && $this->_tableInfo->value[$key]['length'] === 36) {
|
||||
$fields[] = $this->primaryKey;
|
||||
$values[] = String::uuid();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue