diff --git a/models/TicketModel.php b/models/TicketModel.php index b64c837..7e05e42 100644 --- a/models/TicketModel.php +++ b/models/TicketModel.php @@ -726,7 +726,10 @@ class TicketModel $groupConditions = []; foreach ($userGroups as $group) { $groupConditions[] = "FIND_IN_SET(?, REPLACE(t.visibility_groups, ' ', ''))"; - $params[] = $group; + // Strip spaces from the bound value too, matching the REPLACE() + // applied to the column, so a group name like "IT Support" is + // normalized the same way on both sides of the comparison. + $params[] = str_replace(' ', '', $group); $types .= 's'; } $conditions[] = "(t.visibility = 'internal' AND (" . implode(' OR ', $groupConditions) . "))";