From bbfe05bf5432c27d72c075d5b110164284de7ae0 Mon Sep 17 00:00:00 2001 From: Llewellyn Marshall Date: Fri, 9 Dec 2022 15:40:54 -0500 Subject: [PATCH] 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 --- Open-ILS/web/reports/oils_rpt_folders.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- 2.11.0