mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fix notice error for fixtures with imported tables.
Don't emit an error when a fixture has an imported table with no primary. Fixes #3659
This commit is contained in:
parent
c1c9a9dfc4
commit
e3b870dbf7
1 changed files with 5 additions and 1 deletions
|
@ -283,7 +283,11 @@ class CakeTestFixture {
|
|||
$nested = $db->useNestedTransactions;
|
||||
$db->useNestedTransactions = false;
|
||||
$result = $db->insertMulti($this->table, $fields, $values);
|
||||
if ($this->primaryKey && in_array($this->fields[$this->primaryKey]['type'], array('integer', 'biginteger'))) {
|
||||
if (
|
||||
$this->primaryKey &&
|
||||
isset($this->fields[$this->primaryKey]['type']) &&
|
||||
in_array($this->fields[$this->primaryKey]['type'], array('integer', 'biginteger'))
|
||||
) {
|
||||
$db->resetSequence($this->table, $this->primaryKey);
|
||||
}
|
||||
$db->useNestedTransactions = $nested;
|
||||
|
|
Loading…
Reference in a new issue