On Wed, May 2, 2018 at 5:56 PM, Akshay Joshi <akshay.jo...@enterprisedb.com> wrote:
> Hi Khushboo > > I have reviewed your code and looks good to me. Can we change the message > from "The database name is inappropriate" to some meaningful message, so > that user should know why it is inappropriate. If user will be able to > create database with "=" in name then why Backup, Maintenance and Restore > fails. > > Done. Please find the attached updated patch. > On Wed, May 2, 2018 at 3:44 PM, Khushboo Vashi < > khushboo.va...@enterprisedb.com> wrote: > >> Hi, >> >> Please find the attached patch which will fix RMs # 1220 and #1221. >> >> If the database name contains = then the backup, maintenance and restore >> jobs are failing. >> To fix these, we will display the error message regarding inappropriate >> database name. >> >> Thanks, >> Khushboo >> > > > > -- > *Akshay Joshi* > > *Sr. Software Architect * > > > > *Phone: +91 20-3058-9517Mobile: +91 976-788-8246* >
diff --git a/web/pgadmin/tools/backup/static/js/backup.js b/web/pgadmin/tools/backup/static/js/backup.js index ddbfaee..8ac2f44 100644 --- a/web/pgadmin/tools/backup/static/js/backup.js +++ b/web/pgadmin/tools/backup/static/js/backup.js @@ -984,6 +984,15 @@ commonUtils var treeInfo = node.getTreeNodeHierarchy.apply(node, [i]); + if (treeInfo.database._label.indexOf('=') >= 0) { + alertify.alert( + gettext('Backup error'), + gettext('Backup job creation failed. '+ + 'The database name with equal to sign is not supported by this utility.') + ); + return; + } + // Set current database into model this.view.model.set('database', treeInfo.database._label); diff --git a/web/pgadmin/tools/maintenance/static/js/maintenance.js b/web/pgadmin/tools/maintenance/static/js/maintenance.js index 81e4594..c725f37 100644 --- a/web/pgadmin/tools/maintenance/static/js/maintenance.js +++ b/web/pgadmin/tools/maintenance/static/js/maintenance.js @@ -359,6 +359,15 @@ define([ var treeInfo = node.getTreeNodeHierarchy.apply(node, [i]); + if (treeInfo.database._label.indexOf('=') >= 0) { + Alertify.alert( + gettext('Maintenance error'), + gettext('Maintenance job creation failed. '+ + 'The database name with equal to sign is not supported by this utility.') + ); + return; + } + if (treeInfo.schema != undefined) { schema = treeInfo.schema._label; } diff --git a/web/pgadmin/tools/restore/static/js/restore.js b/web/pgadmin/tools/restore/static/js/restore.js index 5c082a9..f15531d 100644 --- a/web/pgadmin/tools/restore/static/js/restore.js +++ b/web/pgadmin/tools/restore/static/js/restore.js @@ -616,6 +616,16 @@ commonUtils var info = node.getTreeNodeHierarchy.apply(node, [i]), m = this.view.model; + + if (info.database._label.indexOf('=') >= 0) { + alertify.alert( + gettext('Restore error'), + gettext('Restore job creation failed. '+ + 'The database name with equal to sign is not supported by this utility.') + ); + return; + } + // Set current node info into model m.set('database', info.database._label); if (!m.get('custom')) {