LP1750887: Copy Objects when Saving Copy Templates
authorJason Boyer <jboyer@library.in.gov>
Wed, 21 Feb 2018 18:59:44 +0000 (13:59 -0500)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 25 May 2018 20:03:04 +0000 (16:03 -0400)
Copy the callnumbers and statcats objects when saving
copy templates to prevent accidental and confusing
editing of in-memory copies.

cesardv: changed tabs to spaces.

Signed-off-by: Jason Boyer <jboyer@library.in.gov>
Signed-off-by: Cesar Velez <cesar.velez@equinoxinitiative.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js

index 59ef059..b722a1c 100644 (file)
@@ -2216,6 +2216,7 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
                             if (angular.isObject(v)) { // we'll use the pkey
                                 if (v.id) v = v.id();
                                 else if (v.code) v = v.code();
+                                else v = angular.copy(v); // Should only be statcats and callnumbers currently
                             }
             
                             tmpl[k] = v;