Skip to content

Commit 18f4d5e

Browse files
committed
fixed error on setup module with db transaction
1 parent 0e472f5 commit 18f4d5e

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Version 1.5.x -
22
----------------------------
3+
- Bug: fixed error on setup module with db transaction
34

45

56
Version 1.4.1 - 30 Jan, 2021

demos/login-system/protected/modules/setup/models/Setup.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
// Framework
1818
use \A,
1919
\CModel,
20-
\CDatabase;
20+
\CDatabase,
21+
\CConfig;
2122

2223

2324
class Setup extends CModel
@@ -64,6 +65,10 @@ public function doCommit()
6465
*/
6566
public function install($sqlDump = '', $transaction = true, $ignoreErrors = false)
6667
{
68+
if ($transaction) {
69+
$transaction = CConfig::get('db.transaction', false);
70+
}
71+
6772
if (empty($sqlDump)) {
6873
$this->_error = true;
6974
$this->_errorMessage = A::t('setup', 'No SQL statements found! Please check your data file.');

demos/simple-blog/protected/modules/setup/models/Setup.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
// Framework
1818
use \A,
1919
\CModel,
20-
\CDatabase;
20+
\CDatabase,
21+
\CConfig;
2122

2223

2324
class Setup extends CModel
@@ -64,6 +65,10 @@ public function doCommit()
6465
*/
6566
public function install($sqlDump = '', $transaction = true, $ignoreErrors = false)
6667
{
68+
if ($transaction) {
69+
$transaction = CConfig::get('db.transaction', false);
70+
}
71+
6772
if (empty($sqlDump)) {
6873
$this->_error = true;
6974
$this->_errorMessage = A::t('setup', 'No SQL statements found! Please check your data file.');

demos/simple-cms/protected/modules/setup/models/Setup.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
// Framework
1818
use \A,
1919
\CModel,
20-
\CDatabase;
20+
\CDatabase,
21+
\CConfig;
2122

2223

2324
class Setup extends CModel
@@ -64,6 +65,10 @@ public function doCommit()
6465
*/
6566
public function install($sqlDump = '', $transaction = true, $ignoreErrors = false)
6667
{
68+
if ($transaction) {
69+
$transaction = CConfig::get('db.transaction', false);
70+
}
71+
6772
if (empty($sqlDump)) {
6873
$this->_error = true;
6974
$this->_errorMessage = A::t('setup', 'No SQL statements found! Please check your data file.');

0 commit comments

Comments
 (0)