This patch fixes a regression where attempting to change
the value of an egOrgSelector embedded in an egEditFmRecord
would result in errors like this:
Error: [$compile:nonassign] http://errors.angularjs.org/1.5.11/$compile/nonassign?p0=rec_orgs%5Bfield.name%5D()&p1=selected&p2=egOrgSelector
To test
-------
[1] Open the MARC Tag Tables admin interface in the web
staff client and edit an existing entry. Note that
changing the selected OU will result in there being
no change and error messages appearing in the browser
JavaScript console.
[2] Apply the patch and repeat step 1.
[3] Verify that no errors are logged.
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
</select>
</span>
<eg-org-selector ng-if="field.datatype == 'org_unit'"
- selected="rec_orgs[field.name]()"
- onchange="rec_orgs[field.name]">
+ selected="rec_org_values[field.name]"
+ onchange="rec_orgs[field.name]" nodefault>
</eg-org-selector>
</div>
</div>
$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) {
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) });