From 59ee9ad21abd692bd042578e06ccb14a998bddc9 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Wed, 23 Dec 2015 15:18:31 -0500 Subject: [PATCH] Default the Dojo OU selector to the current WS value Because this.orgDefaultsToWs does not appear to be set, even though po/create.js tries to set it, we want a sane default anyway. Signed-off-by: Dan Scott --- Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js index 6738ffd63c..f32b8e2963 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js @@ -632,6 +632,12 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) { if(this.widgetValue == null && this.orgDefaultsToWs) this.widgetValue = user.user.ws_ou(); + + // this.orgDefaultsToWs seems to always be undefined, so + // fall back to a sane default + if (this.widgetValue == null) { + this.widgetValue = user.user.ws_ou(); + } // if we have a limit perm, find the relevent orgs (async) if(this.orgLimitPerms && this.orgLimitPerms.length > 0) { -- 2.11.0