From 934e50025335325de1a6d232c97ef2cdd67f7c3e Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Tue, 10 Dec 2013 15:47:33 +0000 Subject: [PATCH] Setup: fixed issue when upgrading a DB (no install dir specified, thus no config file) and requesting a backup: the backup is created without the config file in it. (Updated the readme for the upcoming release!) SVN:trunk[3037] --- readme.txt | 2 +- setup/backup.class.inc.php | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/readme.txt b/readme.txt index 4caf2db95..8ad673a95 100644 --- a/readme.txt +++ b/readme.txt @@ -373,7 +373,7 @@ Portal security enhancements: #851 Ampersand (aka '&') not welcomed in the setup wizard PHP Mail transport to allow 100% of recipients in BCC (regression introduced in 2.0.1) Regression of 2.0.2 beta: Configure this list + discard all columns: the list cannot be loaded anymore (if saved) - +Setup: fixed issue when upgrading a DB (no install dir specified, thus no config file) and requesting a backup: the backup is created without the config file in it. 3.2. Known limitations (https://sourceforge.net/apps/trac/itop/report/3) ----------------- diff --git a/setup/backup.class.inc.php b/setup/backup.class.inc.php index f53b56de4..f7d84dae1 100644 --- a/setup/backup.class.inc.php +++ b/setup/backup.class.inc.php @@ -112,23 +112,26 @@ class DBBackup $sDataFile = tempnam(SetupUtils::GetTmpDir(), 'itop-'); $this->LogInfo("Data file: '$sDataFile'"); + $aContents = array(); + $aContents[] = array( + 'source' => $sDataFile, + 'dest' => 'itop-dump.sql', + ); + if (is_null($sSourceConfigFile)) { $sSourceConfigFile = MetaModel::GetConfig()->GetLoadedFile(); } + if (!empty($sSourceConfigFile)) + { + $aContents[] = array( + 'source' => $sSourceConfigFile, + 'dest' => 'config-itop.php', + ); + } $this->DoBackup($sDataFile); - $aContents = array( - array( - 'source' => $sDataFile, - 'dest' => 'itop-dump.sql', - ), - array( - 'source' => $sSourceConfigFile, - 'dest' => 'config-itop.php', - ), - ); $sDeltaFile = APPROOT.'data/'.utils::GetCurrentEnvironment().'.delta.xml'; if (file_exists($sDeltaFile)) {