AJAX link broken if flaggable entity id is string

Created on 9 May 2023, over 1 year ago

Problem/Motivation

We use an entity which id's is a string and can contain capital characters.
I noticed that twig uses "clean_class" ('\Drupal\Component\Utility\Html::getClass') but in controller we use Html::cleanCssIdentifier.
This causes that js and markup uses different class and user can not flag/unflag entity.
The following error is generated: "An error occurred during the execution of the Ajax response: Error: Syntax error, unrecognized expression ..."

Proposed resolution

Use getClass in both places so we have exactly the same class name.

🐛 Bug report
Status

Active

Component

Flag core

Created by

🇵🇱Poland alorenc Wolsztyn, 🇵🇱

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

Comments & Activities

Production build 0.71.5 2024