- Merge request !9Issue #3217934: Remove escaped HTML Tags from Reference View → (Open) created by Tuuuukka
- 🇬🇷Greece giorgosk Chios, Greece 🇬🇷
Workaround: If one updates all view fields and changes in the style section
Customize field and label wrapper HTML
Customize label HTML
Customize field HTMLand sets the Element to none, no HTML is passed to select2 and there is no need for this patch.
- Status changed to Fixed
over 1 year ago 10:57am 5 May 2023 - 🇩🇪Germany chr.fritsch 🇩🇪🇪🇺🌍
I think the workaround from @GiorgosK is fine. If you think select2 should do some additional work, feel free to reopen the issue.
- Status changed to Closed: works as designed
over 1 year ago 6:46am 19 May 2023 - 🇬🇷Greece giorgosk Chios, Greece 🇬🇷
So technically this should be works as designed
- 🇺🇦Ukraine Kostiantyn
@tuuuukka When I apply the patch, I encounter the error
"TypeError: undefined is not an object (evaluating 'drupalSettings.select2.htmlAsText')"
. The error disappears when I set the configuration for the field, but it's not very convenient to set these settings for every field, even for those where these values are not needed. - 🇩🇪Germany Duwid
I'm working on a case where I need to keep and render the html from select2 results, instead of removing it as described in @GiorgosK workaround. Therefore I will open this issue again, because I think the implemented solution from @Tuuuukka is a great improvement. I just found a little issue in select2.js:
if (drupalSettings.select2.htmlAsText === false) {
htmlAsText is int 0, so it should be:
if (drupalSettings.select2.htmlAsText === 0) {
- Status changed to Needs review
9 months ago 9:18am 4 March 2024 - 🇺🇦Ukraine Kostiantyn
@Duwid, thank you for your improvement, I am testing it right now.
- Status changed to RTBC
9 months ago 11:24am 5 March 2024 - 🇩🇪Germany Duwid
This patch robustifys implementation if htmlAsText is not available because select2 widget is programmatically implemented via form api. For example this is the case social group invite module.