Problem/Motivation
1. The conditional message is being output without any filters applied. It happens because (with the current code) we are calling "check_markup()" and save the value manually during the form validation. But after successful validation, Drupal automatically rewrites that variable with the data taken from the form.
I have to add we should stick to the Drupal standards and keep user input AS IS, applying filters only for output.
2. The format filter selected by the user is not kept after the admin form reload. It may lead to unwanted format changes after submitting the admin form. It happens because we are using an undefined variable as a source for the input format. By the way, we have a @todo mark there.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | conditional_message-format-filter-not-applied-3111286-2.patch | 3.58 KB | savel |
Comments
Comment #2
savel commentedHere is the fix. Review, please
Comment #3
wranvaud commentedYes! Thank you for reminding best practices. Committed.
Will leave this open to check the d8 version for this as well.
Comment #5
wranvaud commentedClosing as a D7 only issue, if needed we should open a ticket for D8/9+