BUG 9896 Error message when restoring a workspace, that truncates the restore.

When restoring a workspace, there is an error message: 'Could not create the directory....' that truncates the restore. So a validation was added to create the folder that was not finding when doing the restore.
This commit is contained in:
jennylee
2013-02-18 11:09:37 -04:00
parent 86fa875be9
commit 2ab284a6a7

View File

@@ -380,7 +380,7 @@ function run_workspace_backup($args, $opts) {
$filename = PATH_DATA . "backups/$filename";
}
CLI::logging("Backing up to $filename\n");
$filesize = array_key_exists("filesize", $opts) ? $opts['filesize'] : -1;
if($filesize >= 0)
{
@@ -414,6 +414,12 @@ function run_workspace_backup($args, $opts) {
function run_workspace_restore($args, $opts) {
$filename = $args[0];
if(!file_exists(PATH_DATA . 'upgrade')) {
print_r(PATH_DATA . 'upgrade');
G::verifyPath(PATH_DATA . 'upgrade', true);
}
if (strpos($filename, "/") === false && strpos($filename, '\\') === false) {
$filename = PATH_DATA . "backups/$filename";
if (!file_exists($filename) && substr_compare($filename, ".tar", -4, 4, true) != 0)