- Issue created by @mrshowerman
- 🇩🇪Germany Anybody Porta Westfalica
Thanks @mrshowerman!
I think as first step, we should add a warning in this module, if the setting you're talking about is enabled. This should be detectable from the webform's config value.
Honestly, I'm not sure if this is solvable in a secure way at all, as the editor might just strip the JavaScript and that's not something we would revert.
If that's the case, we need to look for other solutions, but when writing this module we already did that and didn't find a better way without needing Webform to provide support for this case and that was denied so far...
Very happy to review patches and further ideas!
- Open on Drupal.org →Core: 10.0.7 + Environment: PHP 8.1 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - @mrshowerman opened merge request.
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 12:15pm 14 September 2023 - 🇩🇪Germany mrshowerman Munich
I know that we might lose some formatting in the confirmation message if text format features are used that aren't supported in Webform's editor markup, but since we can set the text format for all elements only and not on a per-element basis, the only way is to override the format.
I think this is acceptable in this case, because when you actively use this module, you would expect to do what it should.That's what the MR is trying to do.
I agree that adding a warning to the field if a different format is selected might be helpful, so site builders aren't surprised by the format change. - 🇩🇪Germany Anybody Porta Westfalica
Thanks @mrshowerman looks acceptable. Still the code and comments aren't clear enough from my perspective to understand why this is needed and what it does. Could you improve that?
Someone new into the code should be able to understand what these lines do and why they are needed. Otherwise, this might be removed one day in a refactoring, if someone thinks it's unnecessary.
- Status changed to Needs work
over 1 year ago 12:36pm 14 September 2023 - 🇩🇪Germany Anybody Porta Westfalica
Once finished, we also need test coverage to ensure the current functionality isn't broken (not matching the if) and the described functionality works as expected (matching the if).
- Open on Drupal.org →Core: 10.0.7 + Environment: PHP 8.1 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - 🇩🇪Germany mrshowerman Munich
I updated the code comment so it's hopefully clear what we're trying to do. Also added some explanation to the confirmation message help text.
I'm working on a test as well, but that's not finished yet. - last update
over 1 year ago Unable to generate test groups - Status changed to Needs review
over 1 year ago 12:44pm 22 September 2023 - 🇩🇪Germany Anybody Porta Westfalica
@mrshowerman thanks! Please note: 🐛 Fix failing tests and code style issues Active
- 🇩🇪Germany mrshowerman Munich
Yes, I saw those code style issues. Good to know there's already an issue.
- 🇩🇪Germany mrshowerman Munich
Added test group, but test still fails, probably due to 🐛 Tests fail because webform stable is not Drupal 10 compatible Active .
- 🇫🇷France GuillaumeDuveau Toulouse
Hi, it looks good however there's another case : if we use CodeMirror for the rich-text fields, there is no allowed_tags list. But maybe it's misconfiguration on my end or an issue related to webform itself.
dpm($variables['message']);
array:1 [▼ "#markup" => "" ]