From 3880bc7eb829e786d50d115e95acb2b2d77d20e8 Mon Sep 17 00:00:00 2001 From: RAJASEKAR G Date: Thu, 6 Apr 2017 09:56:52 +0100 Subject: [PATCH] Fix validation on the table dialogue so the Save button isn't enabled if the name is removed and autovac custom settings are enabled. Fixes #2105 --- .../databases/schemas/tables/templates/table/js/table.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/js/table.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/js/table.js index 13de08a9a..3487e7e10 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/js/table.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/js/table.js @@ -734,8 +734,6 @@ function($, _, S, pgAdmin, pgBrowser, alertify) { schema = this.get('schema'), relowner = this.get('relowner'); - this.errorModel.clear(); - // If nothing to validate or VacuumSetting keys then // return from here if ( keys && (keys.length == 0 @@ -744,6 +742,9 @@ function($, _, S, pgAdmin, pgBrowser, alertify) { return null; } + // Have to clear existing validation before initiating current state validation only + this.errorModel.clear(); + if (_.isUndefined(name) || _.isNull(name) || String(name).replace(/^\s+|\s+$/g, '') == '') { msg = '{{ _('Table name cannot be empty.') }}';