From: eileen Date: Sun, 12 Jul 2020 10:58:48 +0000 (+1200) Subject: Sort permittedActivityTypes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ce0e9bdc43b1006d5259a8bad77dd5883e2561ed;p=civicrm-core.git Sort permittedActivityTypes When determining whether to add a clause filtering activity types the permitted types are compared to all types. If all are permitted no clause is needed. However, without this sort it is incorrectly seeing them as not matching and adding extraneous joins --- diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index cea9b53355..a4065942ca 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -2455,6 +2455,7 @@ INNER JOIN civicrm_option_group grp ON (grp.id = option_group_id AND grp.name = foreach ($types as $type) { $permittedActivityTypes[$type['activity_type_id']] = (int) $type['activity_type_id']; } + asort($permittedActivityTypes); Civi::$statics[__CLASS__]['permitted_activity_types'][$userID] = $permittedActivityTypes; } return Civi::$statics[__CLASS__]['permitted_activity_types'][$userID];