From: Jason Etheridge Date: Thu, 20 Sep 2012 17:10:15 +0000 (-0400) Subject: LP1053526 - Don't inadvertently modify the in-memory org tree when printing X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=77be46a2947c16cceae185877b6685904ae54f65;p=evergreen%2Fequinox.git LP1053526 - Don't inadvertently modify the in-memory org tree when printing To see an example of this causing a problem, load Holdings Maintenance for an arbitrary bib record with items. Make sure the Hide Empty Libs checkbox is checked. Hit the Print button at the bottom of the UI (it's okay to then Cancel the print). Then hit Refresh. It should result in an org.children() is null error. Signed-off-by: Jason Etheridge Signed-off-by: Ben Shum --- diff --git a/Open-ILS/xul/staff_client/chrome/content/util/list.js b/Open-ILS/xul/staff_client/chrome/content/util/list.js index 9b37385d6c..e9bf29a9ea 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/list.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/list.js @@ -1574,8 +1574,8 @@ util.list.prototype = { params.staff = data.list.au[0]; } if (!params.lib && data.list.au && data.list.au[0] && data.list.au[0].ws_ou() && data.hash.aou && data.hash.aou[ data.list.au[0].ws_ou() ]) { - params.lib = data.hash.aou[ data.list.au[0].ws_ou() ]; - params.lib.children(null); + params.lib = JSON2js( js2JSON( data.hash.aou[ data.list.au[0].ws_ou() ] ) ); // clone this sucker + params.lib.children(null); // since we're modifying it } if (params.template && data.print_list_templates[ params.template ]) { var template = data.print_list_templates[ params.template ];