From: Bill Erickson Date: Tue, 23 Jan 2018 22:56:51 +0000 (-0500) Subject: LP#1743608 Replace barcode discards NULL/accidental entries X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=bbfa709f7655539cc8496721b2e1dc01449355d8;p=evergreen%2Fpines.git LP#1743608 Replace barcode discards NULL/accidental entries When replacing a patron's barcode in the patron editor, discard any previous replacement attempts done in the current edit session. This prevents cases where secondary, etc. replacement cards are accidentally created or NULL cards that result in ugly error messages. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js index 6b9780f3b4..4a00507a4b 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js @@ -1458,6 +1458,11 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore , new_card.active = true; new_card._primary = 'on'; $scope.patron.card = new_card; + + // Remove any previous attempts to replace the card, since they + // may be incomplete or created by accident. + $scope.patron.cards = + $scope.patron.cards.filter(function(c) {return !c.isnew}) $scope.patron.cards.push(new_card); }