From: Galen Charlton Date: Fri, 4 Jan 2013 19:33:28 +0000 (-0500) Subject: fix user session management for MARC Batch Edit X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=05902fbb7ab5417ff1c38ff476bd6be47be1020e;p=contrib%2FConifer.git fix user session management for MARC Batch Edit The Javascript in the hardcoded page templates was not checking the XUL stash for the session key when run from the staff client; this is now needed as a result of the XULRunner updates introdued by commit adee850f. As a consequence, the list of the user's record buckets was not retrieved, and attempts to run a batch edit would spin without updating any records. This fixes LP#1048707 and LP#1054277. Signed-off-by: Galen Charlton Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/TemplateBatchBibUpdate.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/TemplateBatchBibUpdate.pm index f72ac17f90..a8199c8809 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/TemplateBatchBibUpdate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/TemplateBatchBibUpdate.pm @@ -232,11 +232,18 @@ sub show_processing_template { dojo.require('fieldmapper.AutoIDL'); dojo.require('fieldmapper.dojoData'); dojo.require('openils.User'); + dojo.require('openils.XUL'); + dojo.require('dojo.cookie'); dojo.require('openils.CGI'); dojo.require('openils.widget.ProgressDialog'); var cgi = new openils.CGI(); - var u = new openils.User({ authcookie : 'ses' }); + var authtoken = dojo.cookie('ses') || cgi.param('ses'); + if (!authtoken && openils.XUL.isXUL()) { + var stash = openils.XUL.getStash(); + authtoken = stash.session.key; + } + var u = new openils.User({ authtoken: authtoken }); dojo.addOnLoad(function () { progress_dialog.show(true); @@ -358,9 +365,16 @@ sub show_template { dojo.require('fieldmapper.dojoData'); dojo.require('openils.User'); dojo.require('openils.CGI'); + dojo.require('openils.XUL'); + dojo.require('dojo.cookie'); var cgi = new openils.CGI(); - var u = new openils.User({ authcookie : 'ses' }); + var authtoken = dojo.cookie('ses') || cgi.param('ses'); + if (!authtoken && openils.XUL.isXUL()) { + var stash = openils.XUL.getStash(); + authtoken = stash.session.key; + } + var u = new openils.User({ authtoken: authtoken }); var bucketStore = new dojo.data.ItemFileReadStore( { data : cbreb.toStoreData(