diff --git a/Duplicati/Server/Database/Connection.cs b/Duplicati/Server/Database/Connection.cs index 320f2f2c0..0b4d140be 100644 --- a/Duplicati/Server/Database/Connection.cs +++ b/Duplicati/Server/Database/Connection.cs @@ -518,7 +518,7 @@ namespace Duplicati.Server.Database return new object[] { n.Name, - n.Description, + n.Description == null ? "" : n.Description, // Description is optional but the column is set to NOT NULL, an additional check is welcome string.Join(",", n.Tags ?? new string[0]), n.TargetURL, update ? (object)item.ID : (object)n.DBPath diff --git a/Duplicati/Server/Database/Database schema/6. Add Description to Backup.sql b/Duplicati/Server/Database/Database schema/6. Add Description to Backup.sql index 61e5edeb1..1b6ae99eb 100644 --- a/Duplicati/Server/Database/Database schema/6. Add Description to Backup.sql +++ b/Duplicati/Server/Database/Database schema/6. Add Description to Backup.sql @@ -1 +1 @@ -ALTER TABLE "Backup" ADD COLUMN "Description" TEXT NULL; +ALTER TABLE "Backup" ADD COLUMN "Description" TEXT NOT NULL DEFAULT ''; diff --git a/Duplicati/Server/webroot/ngax/scripts/controllers/EditBackupController.js b/Duplicati/Server/webroot/ngax/scripts/controllers/EditBackupController.js index 0aa3b2f3b..bc809d2be 100644 --- a/Duplicati/Server/webroot/ngax/scripts/controllers/EditBackupController.js +++ b/Duplicati/Server/webroot/ngax/scripts/controllers/EditBackupController.js @@ -221,7 +221,6 @@ backupApp.controller('EditBackupController', function ($rootScope, $scope, $rout return; } - if (encryptionEnabled) { if ($scope.PassphraseScore === '') { DialogService.dialog(gettextCatalog.getString('Missing passphrase'), gettextCatalog.getString('You must enter a passphrase or disable encryption')); @@ -487,6 +486,13 @@ backupApp.controller('EditBackupController', function ($rootScope, $scope, $rout var filters = $scope.Backup.Filters; $scope.Backup.Filters = []; + // If Description is anything other than a string, we are either creating a new + // backup or something went wrong when retrieving an existing one + // Either way we should set it to an empty string + if (typeof $scope.Backup.Description !== 'string') { + $scope.Backup.Description = ''; + } + $scope.Backup.Sources = $scope.Backup.Sources || []; for(var ix in filters) diff --git a/Duplicati/Server/webroot/ngax/templates/addoredit.html b/Duplicati/Server/webroot/ngax/templates/addoredit.html index fdde1d45d..2f7f76b5d 100755 --- a/Duplicati/Server/webroot/ngax/templates/addoredit.html +++ b/Duplicati/Server/webroot/ngax/templates/addoredit.html @@ -40,7 +40,7 @@