Removing the format field breaks other modules

Created on 2 December 2016, almost 8 years ago
Updated 27 April 2023, over 1 year ago

At present, if there is only one text format available, the better_formats module completely hides the format select field by setting its '#access' attribute to FALSE.

This means that when the form is rendered, there is no format field included in the HTML, and thus no format value included with the form submission. This is breaking anything that needs to detect whether a text field could contain HTML content in client-side script. (In my case, using the Media browser to insert and override file entity properties: it needs to URLEncode HTML text for conversion into a token value, and does so by looking for a submitted format value).

Can I suggest hiding that single-value format field from the user by making it a hidden field, instead of by removing it from the rendered form? That means it's value is still in the form results, and thus available to anything that needs it.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇦🇺Australia LittleRedHen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024