mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
fixed: CakeFixtureManager::_setupTable() is called outside of transaction
Fixed PDOException thrown with the message "There is no active transaction" in PHP 8.0+. SQL like CREATE/DROP/TRUNCATE TABLE implicitly commits just before. In PHP 8.0+, calling commit/rollback afterwards will now throw a PDOException.
This commit is contained in:
parent
b1229c9107
commit
5ae08a4dba
1 changed files with 1 additions and 1 deletions
|
@ -229,8 +229,8 @@ class CakeFixtureManager {
|
||||||
if (!empty($this->_loaded[$f])) {
|
if (!empty($this->_loaded[$f])) {
|
||||||
$fixture = $this->_loaded[$f];
|
$fixture = $this->_loaded[$f];
|
||||||
$db = ConnectionManager::getDataSource($fixture->useDbConfig);
|
$db = ConnectionManager::getDataSource($fixture->useDbConfig);
|
||||||
$db->begin();
|
|
||||||
$this->_setupTable($fixture, $db, $test->dropTables);
|
$this->_setupTable($fixture, $db, $test->dropTables);
|
||||||
|
$db->begin();
|
||||||
$fixture->insert($db);
|
$fixture->insert($db);
|
||||||
$db->commit();
|
$db->commit();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue