From 7387ce9cfd181173f64b265e9ec13815d487271c Mon Sep 17 00:00:00 2001 From: James Fournie Date: Tue, 15 Nov 2011 16:56:16 -0800 Subject: [PATCH] Making the user profile selector disabled rather than readonly in the case of a user editing their own account. This prevents a nasty bug whereby Dojo widgets with the readOnly flag set become labels and therefore do not correctly hold a 'value' like a normal form widget. See LP#806625 for details. Signed-off-by: James Fournie Signed-off-by: Mike Rylander --- Open-ILS/web/js/ui/default/actor/user/register.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Open-ILS/web/js/ui/default/actor/user/register.js b/Open-ILS/web/js/ui/default/actor/user/register.js index fffe460eea..f30a3b2ab8 100644 --- a/Open-ILS/web/js/ui/default/actor/user/register.js +++ b/Open-ILS/web/js/ui/default/actor/user/register.js @@ -909,8 +909,6 @@ function fleshFMRow(row, fmcls, args) { // not overwritten when the profile groups arrive and update wargs.forceSync = true; wargs.disableQuery = {usergroup : 'f'}; - if(!patron.isnew() && !checkGrpAppPerm(patron.profile())) - wargs.readOnly = true; } else { wargs.forceSync = false; } @@ -923,7 +921,12 @@ function fleshFMRow(row, fmcls, args) { var widget = new openils.widget.AutoFieldWidget(wargs); widget.build( function(w, ww) { - if(fmfield == 'profile') { trimGrpTree(ww); } + if(fmfield == 'profile') { + trimGrpTree(ww); + if(!patron.isnew() && !checkGrpAppPerm(patron.profile())){ + w.attr('disabled', true); + } + } } ); -- 2.11.0