The hidden webform text format leads to text format selects with only one option

Created on 26 September 2024, 3 months ago

Problem/Motivation

The webform module uses a "webform_default" text format. This format is hidden almost everywhere. It is especially removed from text format selects in WebformHtmlEditor::processTextFormat. This leads to users with permissions only for this text format to see a text format select on text fields outside webforms with "Plain text" as only option, where they previously did not see the text format selection.

Drupal hides the select if only one or no text format is configured. With the new text format, the users ave two text formats available, but then later the webforms module hook removes on of the options.

Steps to reproduce

  1. Give registered users the permission to use the webform_default format, but not any other text formats.
  2. Log in as a user with no other roles.
  3. Visit an edit form, e.g. for a basic page.
  4. The body field should use the Plain Text format, without offering a text format selection. It does offer the selection, but with only one option for "Plain Text". This clutters the user interface and potentially confuses users.

Proposed resolution

What is the webform text format used for? Is there documentation for this anywhere? Is access to the text format only needed for users administering wbforms or also for users of webforms?

I'm pretty sure that an update hook gave registered users the permission for the text format. Why is it necessary for registered users to use it, but not for anonymous guests? If this really needs to be this way, is there a better way to get rid of the text format without leaving the pointless select?

Remaining tasks

User interface changes

API changes

Data model changes

πŸ’¬ Support request
Status

Active

Version

6.2

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany ammaletu Bonn, Germany

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024