[open-ils-commits] [GIT] Evergreen ILS branch rel_2_1 updated. 58c4bbe2f4296fcd0670d527bbbc3ed7c5999728

Evergreen Git git at git.evergreen-ils.org
Tue Nov 15 14:58:48 EST 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_2_1 has been updated
       via  58c4bbe2f4296fcd0670d527bbbc3ed7c5999728 (commit)
      from  90d868448d0e550f4a6548f8df09fcf7569ac3af (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 58c4bbe2f4296fcd0670d527bbbc3ed7c5999728
Author: Mike Rylander <mrylander at gmail.com>
Date:   Tue Nov 15 15:04:08 2011 -0500

    Patch from Jeff Davis (SITKA) fixing cardless patron updates
    
    Quoth the bug report (https://bugs.launchpad.net/evergreen/+bug/851110):
    
      On our Evergreen 2.0.8 system, it sometimes arises that a patron's card gets deleted. If it was the patron's only card, it becomes impossible to add a new card to the account via the staff client.
    
      How to reproduce:
      1. Retrieve a patron record for a patron who has no associated card.
      2. Click the Edit button.
      3. Click Replace Barcode and enter a new barcode.
      4. Click Save. This does not work - the process hangs, and if you hit Reload, you will find that your changes were not saved.
    
      I believe this happens because some code in register.js assumes the patron has at least one card. I have a potential fix that this comment box is too small to contain ... uh, that is to say, I will post it momentarily.
    
    Which he did, and I applied.
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

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 180797e..f74b110 100644
--- a/Open-ILS/web/js/ui/default/actor/user/register.js
+++ b/Open-ILS/web/js/ui/default/actor/user/register.js
@@ -344,9 +344,11 @@ function replaceCardHandler() {
     replaceBarcode.attr('disabled', true);
     
     // pull old card off the cards list so we don't have a dupe sitting in there
-    var old = patron.cards().filter(function(c){return (c.id() == patron.card().id())})[0];
-    old.active('f');
-    old.ischanged(1);
+    if (patron.cards().length > 0) {
+        var old = patron.cards().filter(function(c){return (c.id() == patron.card().id())})[0];
+        old.active('f');
+        old.ischanged(1);
+    }
 
     var newc = new fieldmapper.ac();
     newc.id(uEditCardVirtId--);

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/web/js/ui/default/actor/user/register.js |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list