LP1277556 Fast Item Add no longer opens record after copy is created
authorBlake Henderson <blake@mobiusconsortium.org>
Tue, 1 Jul 2014 22:06:30 +0000 (17:06 -0500)
committerBen Shum <bshum@biblio.org>
Wed, 27 Aug 2014 04:32:48 +0000 (00:32 -0400)
Altered save_attempt to handle undefined and true cases for replace_on_complete
When fastItemAdd is not used, replace_on_complete is undefined
When it is used, and successful, replace_on_complete will be set to true
then we need it to execute result.on_complete()

Signed-off-by: Blake Henderson <blake@mobiusconsortium.org>
Signed-off-by: Remington Steed <rjs7@calvin.edu>
Signed-off-by: Ben Shum <bshum@biblio.org>

Open-ILS/xul/staff_client/server/cat/marcedit.js

index 8359afc..b404510 100644 (file)
@@ -1228,7 +1228,10 @@ function save_attempt(xml_string) {
             if (result.id) {
                 replace_on_complete = fastItemAdd_attempt(result.id);
             }
-            if (!replace_on_complete && typeof result.on_complete == 'function') {
+       // When fastItemAdd is not used, replace_on_complete is undefined
+       // When it is used, and successful, replace_on_complete will be set to true 
+       // then we need it to execute on_complete()
+            if ((replace_on_complete==undefined || replace_on_complete ) && typeof result.on_complete == 'function') {
                 result.on_complete();
             }
         }