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.

Comments

SAVEL created an issue. See original summary.

savel’s picture

Status: Active » Needs review
StatusFileSize
new3.58 KB

Here is the fix. Review, please

wranvaud’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Status: Needs review » Patch (to be ported)

Yes! Thank you for reminding best practices. Committed.
Will leave this open to check the d8 version for this as well.

  • wranvaud committed 4a78620 on 7.x-1.x authored by SAVEL
    Issue #3111286 by SAVEL: Format filter is not applied to Conditional...
wranvaud’s picture

Version: 8.x-1.x-dev » 7.x-1.0-alpha15
Status: Patch (to be ported) » Fixed

Closing as a D7 only issue, if needed we should open a ticket for D8/9+

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.