mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Merging fix from 1.1.x.x branch
[3132] Adding patch from Ticket #1004. This fixed problem with table prefix not being used when querying for the last record id git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3133 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
dfb49aad38
commit
965874ccae
2 changed files with 2 additions and 2 deletions
|
@ -862,7 +862,7 @@ class Model extends Object{
|
|||
}
|
||||
} else {
|
||||
if ($db->create($this, $fields, $values)) {
|
||||
$this->__insertID = $db->lastInsertId($this->table, $this->primaryKey);
|
||||
$this->__insertID = $db->lastInsertId($this->tablePrefix . $this->table, $this->primaryKey);
|
||||
|
||||
if (!$this->__insertID && $newID != null) {
|
||||
$this->__insertID = $newID;
|
||||
|
|
|
@ -859,7 +859,7 @@ class Model extends Object{
|
|||
}
|
||||
} else {
|
||||
if ($db->create($this, $fields, $values)) {
|
||||
$this->__insertID = $db->lastInsertId($this->table, $this->primaryKey);
|
||||
$this->__insertID = $db->lastInsertId($this->tablePrefix . $this->table, $this->primaryKey);
|
||||
|
||||
if (!$this->__insertID && $newID != null) {
|
||||
$this->__insertID = $newID;
|
||||
|
|
Loading…
Reference in a new issue