From: Mike Rylander Date: Tue, 25 Jul 2017 21:10:48 +0000 (-0400) Subject: offline: Make sure the the field_doc structure exists before writing to it X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=83dbb0001134b4323acb7e50b79c67d779aff1f5;p=evergreen%2Ftadl.git offline: Make sure the the field_doc structure exists before writing to it Signed-off-by: Mike Rylander Signed-off-by: Kathy Lussier --- diff --git a/Open-ILS/web/js/ui/default/staff/offline.js b/Open-ILS/web/js/ui/default/staff/offline.js index dab4065b51..12cfc3fe87 100644 --- a/Open-ILS/web/js/ui/default/staff/offline.js +++ b/Open-ILS/web/js/ui/default/staff/offline.js @@ -905,6 +905,8 @@ function($routeProvider , $locationProvider , $compileProvider) { service.get_field_doc = function() { return egLovefield.getListFromOfflineCache('fdoc').then(function (list) { angular.forEach(list, function(doc) { + if (!service.field_doc[doc.fm_class()]) + service.field_doc[doc.fm_class()] = {}; service.field_doc[doc.fm_class()][doc.field()] = doc; }); return $q.when();