From: René Olivo Date: Sat, 11 Aug 2018 23:17:23 +0000 (+0000) Subject: Fixes the following issues with case type management: X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1e921db0238ddf67ed2e54cb4e7f63679c938288;p=civicrm-core.git 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. --- 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;