public inbox for [email protected]
help / color / mirror / Atom feedFrom: Nikhil Mohite <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin][RM-6809]: pgadmin 5.7 not opening
Date: Thu, 28 Oct 2021 15:51:12 +0530
Message-ID: <CAOBg0AMLkaiusAi_8H_dCfkCpWDHeHsy2JaMmb2msRJvjUyF7A@mail.gmail.com> (raw)
Hi Hackers,
Please find the attached patch for RM-6809:
<https://redmine.postgresql.org/issues/6809; pgadmin 5.7 not opening
--
*Thanks & Regards,*
*Nikhil Mohite*
*Senior Software Engineer.*
*EDB Postgres* <https://www.enterprisedb.com/;
*Mob.No: +91-7798364578.*
Attachments:
[application/octet-stream] RM-6809.patch (3.9K, 3-RM-6809.patch)
download | inline diff:
diff --git a/web/pgadmin/browser/static/js/browser.js b/web/pgadmin/browser/static/js/browser.js
index 45f18cb9..3f662a11 100644
--- a/web/pgadmin/browser/static/js/browser.js
+++ b/web/pgadmin/browser/static/js/browser.js
@@ -440,14 +440,16 @@ define('pgadmin.browser', [
initializeBrowserTree(obj);
// Syntax highlight the SQL Pane
- obj.editor = CodeMirror.fromTextArea(
- document.getElementById('sql-textarea'), {
- lineNumbers: true,
- mode: 'text/x-pgsql',
- readOnly: true,
- extraKeys: pgAdmin.Browser.editor_shortcut_keys,
- screenReaderLabel: gettext('SQL'),
- });
+ if(document.getElementById('sql-textarea')){
+ obj.editor = CodeMirror.fromTextArea(
+ document.getElementById('sql-textarea'), {
+ lineNumbers: true,
+ mode: 'text/x-pgsql',
+ readOnly: true,
+ extraKeys: pgAdmin.Browser.editor_shortcut_keys,
+ screenReaderLabel: gettext('SQL'),
+ });
+ }
/* Cache may take time to load for the first time
* Reflect the changes once cache is available
*/
@@ -465,8 +467,8 @@ define('pgadmin.browser', [
});
setTimeout(function() {
- obj.editor.setValue('-- ' + select_object_msg);
- obj.editor.refresh();
+ obj?.editor?.setValue('-- ' + select_object_msg);
+ obj?.editor?.refresh();
}, 10);
// Build the treeview context menu
diff --git a/web/pgadmin/browser/static/js/layout.js b/web/pgadmin/browser/static/js/layout.js
index 5f313867..9491bfaa 100644
--- a/web/pgadmin/browser/static/js/layout.js
+++ b/web/pgadmin/browser/static/js/layout.js
@@ -100,7 +100,10 @@ _.extend(pgBrowser, {
},
lock_layout: function(docker, op) {
- let menu_items = this.menus['file']['mnu_locklayout']['menu_items'];
+ let menu_items = [];
+ if('mnu_locklayout' in this.menus['file']) {
+ menu_items = this.menus['file']['mnu_locklayout']['menu_items'];
+ }
switch(op) {
case this.lock_layout_levels.PREVENT_DOCKING:
@@ -114,13 +117,15 @@ _.extend(pgBrowser, {
break;
}
- _.each(menu_items, function(menu_item) {
- if(menu_item.name != ('mnu_lock_'+op)) {
- menu_item.change_checked(false);
- } else {
- menu_item.change_checked(true);
- }
- });
+ if(menu_items) {
+ _.each(menu_items, function(menu_item) {
+ if(menu_item.name != ('mnu_lock_'+op)) {
+ menu_item.change_checked(false);
+ } else {
+ menu_item.change_checked(true);
+ }
+ });
+ }
},
save_lock_layout: function(op) {
diff --git a/web/pgadmin/browser/static/js/preferences.js b/web/pgadmin/browser/static/js/preferences.js
index 98b006fc..a41e68a1 100644
--- a/web/pgadmin/browser/static/js/preferences.js
+++ b/web/pgadmin/browser/static/js/preferences.js
@@ -124,14 +124,14 @@ _.extend(pgBrowser, {
if(module === 'sqleditor' || module === null || typeof module === 'undefined') {
let sqlEditPreferences = obj.get_preferences_for_module('sqleditor');
- $(obj.editor.getWrapperElement()).css(
+ $(obj?.editor?.getWrapperElement()).css(
'font-size',SqlEditorUtils.calcFontSize(sqlEditPreferences.sql_font_size)
);
- obj.editor.setOption('tabSize', sqlEditPreferences.tab_size);
- obj.editor.setOption('lineWrapping', sqlEditPreferences.wrap_code);
- obj.editor.setOption('autoCloseBrackets', sqlEditPreferences.insert_pair_brackets);
- obj.editor.setOption('matchBrackets', sqlEditPreferences.brace_matching);
- obj.editor.refresh();
+ obj?.editor?.setOption('tabSize', sqlEditPreferences.tab_size);
+ obj?.editor?.setOption('lineWrapping', sqlEditPreferences.wrap_code);
+ obj?.editor?.setOption('autoCloseBrackets', sqlEditPreferences.insert_pair_brackets);
+ obj?.editor?.setOption('matchBrackets', sqlEditPreferences.brace_matching);
+ obj?.editor?.refresh();
}
},
view thread (2+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: [pgAdmin][RM-6809]: pgadmin 5.7 not opening
In-Reply-To: <CAOBg0AMLkaiusAi_8H_dCfkCpWDHeHsy2JaMmb2msRJvjUyF7A@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox