From 1e921db0238ddf67ed2e54cb4e7f63679c938288 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ren=C3=A9=20Olivo?= Date: Sat, 11 Aug 2018 23:17:23 +0000 Subject: [PATCH] Fixes the following issues with case type management: * When selecting default assignees by relationships, it will only display active relationship types. * It also handles activity types that have been deleted. Without taking this into consideration, the screen would break if it encounters a missing activity type. --- ang/crmCaseType.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ang/crmCaseType.js b/ang/crmCaseType.js index 12500df615..9540bb065c 100644 --- a/ang/crmCaseType.js +++ b/ang/crmCaseType.js @@ -76,6 +76,7 @@ }]; reqs.relTypes = ['RelationshipType', 'get', { sequential: 1, + is_active: 1, options: { sort: CRM.crmCaseType.REL_TYPE_CNAME, limit: 0 @@ -315,7 +316,8 @@ _.each($scope.caseType.definition.activitySets, function (set) { _.each(set.activityTypes, function (type, name) { var isDefaultAssigneeTypeUndefined = _.isUndefined(type.default_assignee_type); - type.label = $scope.activityTypes[type.name].label; + var typeDefinition = $scope.activityTypes[type.name]; + type.label = (typeDefinition && typeDefinition.label) || type.name; if (isDefaultAssigneeTypeUndefined) { type.default_assignee_type = defaultAssigneeDefaultValue.value; -- 2.25.1