stat_cat_entries not set on new copies
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 21 Feb 2006 19:52:37 +0000 (19:52 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 21 Feb 2006 19:52:37 +0000 (19:52 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@3150 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 2b6fe9e..7991a0e 100644 (file)
@@ -127,6 +127,7 @@ function my_init() {
                /* Other stat cats present on these copies */
                for (var i = 0; i < g.copies.length; i++) {
                        var entries = g.copies[i].stat_cat_entries();
                /* Other stat cats present on these copies */
                for (var i = 0; i < g.copies.length; i++) {
                        var entries = g.copies[i].stat_cat_entries();
+                       if (!entries) entries = [];
                        for (var j = 0; j < entries.length; j++) {
                                var sc_id = entries[j].stat_cat();
                                add_stat_cat( sc_id );
                        for (var j = 0; j < entries.length; j++) {
                                var sc_id = entries[j].stat_cat();
                                add_stat_cat( sc_id );
@@ -172,6 +173,7 @@ g.apply_stat_cat = function(sc_id,entry_id) {
                try {
                        copy.ischanged('1');
                        var temp = copy.stat_cat_entries();
                try {
                        copy.ischanged('1');
                        var temp = copy.stat_cat_entries();
+                       if (!temp) temp = [];
                        temp = util.functional.filter_list(
                                temp,
                                function (obj) {
                        temp = util.functional.filter_list(
                                temp,
                                function (obj) {