From: Dan Scott Date: Wed, 23 Dec 2015 20:18:31 +0000 (-0500) Subject: Default the Dojo OU selector to the current WS value X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=59ee9ad21abd692bd042578e06ccb14a998bddc9;p=contrib%2FConifer.git 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 --- 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) {