LP#1402797 Avoid org tree retrieval race condition on patron app
authorBill Erickson <berickxx@gmail.com>
Wed, 3 Dec 2014 17:48:12 +0000 (12:48 -0500)
committerBill Erickson <berickxx@gmail.com>
Thu, 12 Feb 2015 16:58:27 +0000 (11:58 -0500)
commit7f6170bd1cca9fe41d7f6074e118231dda5e04e3
tree0739c3c2d54fbe22f63535cbe750f85a87ae223d
parent2c7d8eb5085e283d7e0e702e41053db58e5ef251
LP#1402797 Avoid org tree retrieval race condition on patron app

Avoid calling egOrg.ancestors() during startup, because the org unit
tree is not guarantee to be available until startup has completed.  This
was causing an occasional JS excpetion in the patron app pages, which
prevented the pages from loading.

The error in question:

 TypeError: Cannot read property 'map' of undefined
    at Object.service.get (https://host/js/ui/default/staff/services/org.js:21:25)
    at Object.service.ancestors (https://host/js/ui/default/staff/services/org.js:34:28)
    at Object.egCore.env.classLoaders.actsc (https://host/js/ui/default/staff/circ/patron/app.js:41:37)
    at https://host/js/ui/default/staff/services/env.js:77:55
    at Object.r [as forEach] (https://host/js/ui/default/staff/build/js/angular.min.js:7:290)
    at Object.service.load (https://host/js/ui/default/staff/services/env.js:76:17)
    at https://host/js/ui/default/staff/services/startup.js:64:23
    at J (https://host/js/ui/default/staff/build/js/angular.min.js:101:96)
    at https://host/js/ui/default/staff/build/js/angular.min.js:102:259
    at h.$eval (https://host/js/ui/default/staff/build/js/angular.min.js:113:32)

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/web/js/ui/default/staff/circ/patron/app.js