Navigation Menu

Skip to content

Commit

Permalink
Fixed issue #15931: Custom table-prefix ignored on installation
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Apr 8, 2020
1 parent dc5e05a commit 4affb80
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion application/commands/InstallCommand.php
Expand Up @@ -56,7 +56,7 @@ public function run($aArguments)
require_once($sFileName);
try {
$this->output('Creating tables...');
createDatabase($this->connection);
populateDatabase($this->connection);
} catch (Exception $e) {
$this->output('Could not create LimeSurvey tables: '.$e->getMessage());
return 1;
Expand Down
2 changes: 1 addition & 1 deletion application/commands/InstallFromConfigCommand.php
Expand Up @@ -87,7 +87,7 @@ public function run($aArguments)
require_once($sFileName);
try {
$this->output('Creating tables...');
createDatabase($this->connection);
populateDatabase($this->connection);
} catch (Exception $e) {
$this->output('Could not create LimeSurvey tables: '.$e->getMessage());
return 1;
Expand Down
2 changes: 2 additions & 0 deletions application/controllers/InstallerController.php
Expand Up @@ -1029,6 +1029,7 @@ private function getModelFromSession($scenario = null)
isset(Yii::app()->session['dbuser']) ? $model->dbuser = Yii::app()->session['dbuser'] : null;
isset(Yii::app()->session['dbpwd']) ? $model->dbpwd = Yii::app()->session['dbpwd'] : null;
isset(Yii::app()->session['dblocation']) ? $model->dblocation = Yii::app()->session['dblocation'] : null;
isset(Yii::app()->session['dbprefix']) ? $model->dbprefix = Yii::app()->session['dbprefix'] : null;
isset(Yii::app()->session['dbExists']) ? $model->dbExists = Yii::app()->session['databaseexist'] : null;
return $model;
}
Expand All @@ -1043,6 +1044,7 @@ private function clearSession() {
unset(Yii::app()->session['dbuser']);
unset(Yii::app()->session['dbpwd']);
unset(Yii::app()->session['dblocation']);
unset(Yii::app()->session['dbprefix']);
unset(Yii::app()->session['dbExists']);
}

Expand Down
2 changes: 1 addition & 1 deletion application/models/InstallerConfigForm.php
Expand Up @@ -646,7 +646,7 @@ public function setupTables()
$fileName = dirname(APPPATH).'/installer/create-database.php';
require_once($fileName);
try {
createDatabase($this->db);
populateDatabase($this->db);
} catch (Exception $e) {
return array($e->getMessage());
}
Expand Down
2 changes: 1 addition & 1 deletion installer/create-database.php
Expand Up @@ -6,7 +6,7 @@
* @throws CHttpException
* @throws CException
*/
function createDatabase($oDB){
function populateDatabase($oDB){
/**
* Populate the database for a limesurvey installation
* Rules:
Expand Down

0 comments on commit 4affb80

Please sign in to comment.