LP#1677416: unbreak use of egOrgSelector by egEditFmRecord
[working/Evergreen.git] / Open-ILS / web / js / ui / default / staff / services / fm_record_editor.js
index da95d54..be04844 100644 (file)
@@ -74,6 +74,7 @@ angular.module('egFmRecordEditorMod',
 
             $scope.record_label = egCore.idl.classes[$scope.idlClass].label;
             $scope.rec_orgs = {};
+            $scope.rec_org_values = {};
 
             if ($scope.mode == 'update') {
                 egCore.pcrud.retrieve($scope.idlClass, $scope.recordId).then(function(r) {
@@ -161,6 +162,9 @@ angular.module('egFmRecordEditorMod',
                             if (arguments.length == 1) $scope.rec[field.name](org.id());
                             return egCore.org.get($scope.rec[field.name]());
                         }
+                        if ($scope.rec[field.name]()) {
+                            $scope.rec_org_values[field.name] = $scope.rec_orgs[field.name]();
+                        }
                     }
                 });
                 return fields.filter(function(field) { return !(field.name in $scope.hidden) });