diff --git a/docs/en_US/release_notes_4_30.rst b/docs/en_US/release_notes_4_30.rst index 3962099cd..7a15eea37 100644 --- a/docs/en_US/release_notes_4_30.rst +++ b/docs/en_US/release_notes_4_30.rst @@ -19,6 +19,7 @@ Housekeeping Bug fixes ********* +| `Issue #4892 `_ - Fixed an issue where pressing the back button will show another instance of the main page inside of the Query Tool tab. | `Issue #5571 `_ - Added support for expression in exclusion constraints. | `Issue #5875 `_ - Ensure that the 'template1' database should not be visible after pg_upgrade. | `Issue #5965 `_ - Ensure that the macro query result should be download properly. diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py index d7e3da9b6..7c1f16523 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py @@ -148,7 +148,8 @@ def check_precondition(f): self.datistemplate = \ self.manager.db_info[kwargs['did']]['datistemplate'] \ if self.manager.db_info is not None and \ - kwargs['did'] in self.manager.db_info else False + kwargs['did'] in self.manager.db_info and \ + 'datistemplate' in self.manager.db_info[kwargs['did']] else False # Set the template path for the SQL scripts if self.manager.server_type == 'gpdb': diff --git a/web/pgadmin/tools/datagrid/static/js/datagrid.js b/web/pgadmin/tools/datagrid/static/js/datagrid.js index 20ed9da4b..b698c08e7 100644 --- a/web/pgadmin/tools/datagrid/static/js/datagrid.js +++ b/web/pgadmin/tools/datagrid/static/js/datagrid.js @@ -299,7 +299,7 @@ define('pgadmin.datagrid', [ ).set({'title': gettext('Rename Panel')}); }); - var openQueryToolURL = function(j) { + var openQueryToolURL = function(j, panel_url) { // add spinner element let $spinner_el = $(`
@@ -315,9 +315,20 @@ define('pgadmin.datagrid', [ if (frameInitialized) { clearInterval(init_poller_id); var frame = $(j).data('embeddedFrame'); + if (frame) { frame.onLoaded(()=>{ $spinner_el.remove(); + // Fix for firefox backspace click causes pgadmin Inception - RM4892 + // start of code + var current_browser = pgAdmin.Browser.get_browser(); + if (current_browser.name === 'Firefox') { + frame.$iFrame[0].contentWindow.history.pushState(null, null, panel_url); + frame.$iFrame[0].contentWindow.onpopstate = function () { + frame.$iFrame[0].contentWindow.history.go(1); + }; + } + // end of code }); frame.openHTML(queryToolForm); } @@ -325,7 +336,7 @@ define('pgadmin.datagrid', [ }, 100); }; - openQueryToolURL(queryToolPanel); + openQueryToolURL(queryToolPanel, panel_url); } return true; },