JBAS-1132 Save (Clone) from staged users repairs
authorBill Erickson <berickxx@gmail.com>
Thu, 17 Mar 2016 20:34:02 +0000 (16:34 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
* Avoid trying to re-register the same staged patron after saving a
  staged patron and reloading the form.

* Avoid trying to remove a staged patron from the pending user grid if
  the patron row has already been removed.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/web/js/ui/default/actor/user/register.js
Open-ILS/xul/staff_client/server/patron/staged.js

index a138930..47faa52 100644 (file)
@@ -2285,6 +2285,9 @@ function uEditRemoveStage() {
 
 function uEditFinishSave(newPatron, doClone) {
 
+    if (xulG && xulG.params)
+      delete xulG.params.stage; // don't try to re-register
+
     if(doClone && cloneUser == null)
         cloneUser = newPatron.id();
 
index 7d1a6d8..90d59b2 100644 (file)
@@ -201,6 +201,9 @@ function load( usrnames ) {
         function gen_on_save_handler(usrname) {
             return function() {
                 try {
+                    // avoid trying to remove the staged user twice.
+                    if (!rows[usrname]) return; 
+
                     var node = rows[ usrname ].treeitem_node;
                     var parentNode = node.parentNode;
                     parentNode.removeChild( node );