Use Html::cleanCssIdentifier instead of custom code for notification type class

Created on 13 May 2025, 26 days ago

Problem/Motivation

If a user adds a DMB Notification Type term that includes non-CSS-safe characters in it, the custom code in DmbNotificationService produces invalid classes.

Steps to reproduce

Add a term to the DMB Notification Type vocabulary with invalid characters in the Name field (such as quotation marks, e.g. Secondary "Toggle" Alert).

Proposed resolution

Use Drupal's core Html utility class to generate a clean CSS class.

API changes

This change might change the class added to the notification based on Notification Type, so it may break existing theming.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jamesgrobertson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024