public inbox for [email protected]  
help / color / mirror / Atom feed
From: Khushboo Vashi <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin 4][Patch] - RM #4953 - Unable to retrieve table node if trigger is already disabled and user Click on Enable All
Date: Mon, 2 Dec 2019 14:24:42 +0530
Message-ID: <CAFOhELfrQh7=mVbgBwOy3VNyuAy7YBxt5aL76wV0xfxqk-ADTg@mail.gmail.com> (raw)

Hi,

Please find the attached patch to fix the RM #4953 - Unable to retrieve
table node if trigger is already disabled and user Click on Enable All.

Thanks,
Khushboo


Attachments:

  [application/octet-stream] RM_4953.patch (1.7K, 3-RM_4953.patch)
  download | inline diff:
diff --git a/web/pgadmin/static/js/tree/pgadmin_tree_node.js b/web/pgadmin/static/js/tree/pgadmin_tree_node.js
index 2a74fd115..f5a3e6e91 100644
--- a/web/pgadmin/static/js/tree/pgadmin_tree_node.js
+++ b/web/pgadmin/static/js/tree/pgadmin_tree_node.js
@@ -43,6 +43,7 @@ export function getTreeNodeHierarchyFromElement(pgBrowser, treeNode) {
 export function getTreeNodeHierarchyFromIdentifier(aciTreeNodeIdentifier) {
   let identifier = this.treeMenu.translateTreeNodeIdFromACITree(aciTreeNodeIdentifier);
   let currentNode = this.treeMenu.findNode(identifier);
+  if (currentNode === null) return null;
   return getTreeNodeHierarchy.call(this, currentNode);
 }
 
diff --git a/web/pgadmin/static/js/tree/pgadmin_tree_save_state.js b/web/pgadmin/static/js/tree/pgadmin_tree_save_state.js
index d4340833a..999027e9e 100644
--- a/web/pgadmin/static/js/tree/pgadmin_tree_save_state.js
+++ b/web/pgadmin/static/js/tree/pgadmin_tree_save_state.js
@@ -211,7 +211,7 @@ _.extend(pgBrowser.browserTreeState, {
       node = data && pgBrowser.Nodes[data._type],
       treeHierarchy = node && node.getTreeNodeHierarchy(item);
 
-    if (!pgBrowser.tree.hasParent(item) || !(self.parent in treeHierarchy))
+    if (treeHierarchy === null || !pgBrowser.tree.hasParent(item) || !(self.parent in treeHierarchy))
       return;
 
     let topParent = treeHierarchy && treeHierarchy[self.parent]['_id'],
@@ -269,7 +269,7 @@ _.extend(pgBrowser.browserTreeState, {
       treeHierarchy = node && node.getTreeNodeHierarchy(item);
 
 
-    if (!pgBrowser.tree.hasParent(item) || !(self.parent in treeHierarchy))
+    if (treeHierarchy === null || !pgBrowser.tree.hasParent(item) || !(self.parent in treeHierarchy))
       return;
 
     // If the server node is open then only we should populate the tree


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 4][Patch] - RM #4953 - Unable to retrieve table node if trigger is already disabled and user Click on Enable All
  In-Reply-To: <CAFOhELfrQh7=mVbgBwOy3VNyuAy7YBxt5aL76wV0xfxqk-ADTg@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