From 7f23400c38641ddefcc2caa472e7198596a895ea Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 29 Sep 2017 09:33:33 -0400 Subject: [PATCH] LP#1720345: ensure egEditFmRecord's customFieldTemplates is optional This patch ensures that the custom-field-templates attribute of the eg-edit-fm-record directive is strictly optional, fixing a regression for instances of that directive that don't need that attribute. To test ------- [1] Apply the patch. [2] Verify that the Server Administration | Copy Tag Types and and Local Administration | Copy Tags admin interfaces allow you to create and edit values. [3] Verify that the Serials Administration | Prediction Pattern Templates interface continues to work. Signed-off-by: Galen Charlton Signed-off-by: Kathy Lussier --- Open-ILS/web/js/ui/default/staff/services/fm_record_editor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/services/fm_record_editor.js b/Open-ILS/web/js/ui/default/staff/services/fm_record_editor.js index 2e08c0754d..4cb38e5a2d 100644 --- a/Open-ILS/web/js/ui/default/staff/services/fm_record_editor.js +++ b/Open-ILS/web/js/ui/default/staff/services/fm_record_editor.js @@ -22,7 +22,7 @@ angular.module('egFmRecordEditorMod', // field value using rec_flat[field.name] // handlers - any functions you want to pass // in to the custom template - customFieldTemplates : '=', + customFieldTemplates : '=?', // comma-separated list of fields that should not be // displayed @@ -191,7 +191,7 @@ angular.module('egFmRecordEditorMod', } field.org_default_allowed = (field.name in $scope.org_default_allowed); } - if (field.name in $scope.customFieldTemplates) { + if (angular.isObject($scope.customFieldTemplates) && (field.name in $scope.customFieldTemplates)) { field.use_custom_template = true; field.custom_template = $scope.customFieldTemplates[field.name].template; field.handlers = $scope.customFieldTemplates[field.name].handlers; -- 2.43.2