- Issue created by @hctom
- Assigned to just_like_good_vibes
- 🇫🇷France pdureau Paris
Thanks a lot Tom for using an early version of UI Patterns 2.x and helping us making the module ready for beta.
Additionally the code of WysiwygWidget::textFormat looks quite outdated and e.g. names Drupal\filter\Element\TextFormat::processTextFormat() which does not exist anymore (it is TextFormat::processFormat() now and has a lot more code to allow limiting formats).
Indeed. It was not caught by our quality tools because it was in a comment.
The ui_patterns_element_info_alter() implementation adds the WysiwygWidget::textFormat #pre_render callback for all text_format elements. Unfortunately this breaks core's functionality to limit a text fields available text formats. In my case, there is only Full HTML allowed, but with ui_patterns module installed, the text format selection is visible again and also allows to select Plain text.
@just_like_good_vibes can you have a look? It seems this is the follow-up of 🐛 [2.0.0-alpha3] WysiwygWidget bug with one text format Fixed
- 🇫🇷France just_like_good_vibes PARIS
Hello, yes i will take the issue. Thank you for reporting the bug hctom.
i will try to fix this very soon. - 🇩🇪Germany hctom
You're welcome - I'm currently evaluating the state of ui_patterns and I am quite impressed so far! ;) Thanks a lot and keep up the good work.
- Status changed to Needs review
3 months ago 9:23am 3 August 2024 - 🇫🇷France just_like_good_vibes PARIS
thank you for your nice comment :)
i have posted a fix, please review.The reason why. we use pre-render, is that we override the default behavior proposed by the form element to always propose the option "Plain text" and to allow all site-wide text formats.
Maybe we could renovate that in the future and simplify.please review if you have some time to do it
- Status changed to RTBC
3 months ago 12:14pm 3 August 2024 - 🇩🇪Germany hctom
Thanks for your fast response and fix. This looks good to me. In my node forms etc. the
Text format
select element is gone again, when only a single text format is allowed and theWysiwyg
source still has theText format
select element available.I'd also say moving the #pre_render callback assignement to the actual source plugin is definitely better, so that code does not run for all
text_format
elements.Thanks a lot again and: RTBC from my side ;)
- 🇫🇷France just_like_good_vibes PARIS
thanks for the quick review. Indeed this was clearly a bug the way it was coded.
And yes we keep the select list in the
Wysiwyg
source form, even if only one format is available.
And we actually have two possible selections with the "Plain text" :) -
just_like_good_vibes →
committed ccbe4bcd on 2.0.x
Issue #3465517 by just_like_good_vibes: ui_patterns_element_info_alter...
-
just_like_good_vibes →
committed ccbe4bcd on 2.0.x
- Issue was unassigned.
- Status changed to Fixed
3 months ago 3:39pm 3 August 2024 - Status changed to Fixed
3 months ago 2:51pm 12 August 2024