From: Llewellyn Marshall Date: Fri, 9 Dec 2022 20:40:54 +0000 (-0500) Subject: LP#1999944: fix bug that can break drawing the folder tree for reports X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=bbfe05bf5432c27d72c075d5b110164284de7ae0;p=Evergreen.git LP#1999944: fix bug that can break drawing the folder tree for reports Specifically, skip drawfolders iteration if parent node cannot be found and eport invalid parent folder in the browser console. For example, if a user creates a template folder that is not shared that has a child folder that _is_ shared, another user at the library that the folder is shared with would see their report folders be incompletely rendered. Signed-off-by: Llewellyn Marshall Signed-off-by: blake Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/web/reports/oils_rpt_folders.js b/Open-ILS/web/reports/oils_rpt_folders.js index 03c961d5b8..1f1a77dcdc 100644 --- a/Open-ILS/web/reports/oils_rpt_folders.js +++ b/Open-ILS/web/reports/oils_rpt_folders.js @@ -304,7 +304,11 @@ oilsRptFolderManager.prototype.drawFolders = function(type, folders) { id = node.treeId; if( folder.parent() ) { var pnode = this.findNode(type, folder.parent()); - pid = pnode.treeId; + if(!pnode){ + console.error("An error occurred retrieving "+type+" folder #"+folder.parent()); + continue; + } + pid = pnode.treeId; node.depth = pnode.depth + 1; } else { node.depth = 0;