Problem/Motivation

When viewing a form, the help text listing the `Allowed types` lists the extensions separated by spaces. Prior to 6.3.x, this was a comma-separated list.

Webform 6.2.6

 txt, rtf, pdf, doc, docx, odt, ppt, pptx, odp, xls, xlsx, ods.

Webform 6.3.x-dev

These screenshots are from Drupal Core 10, but I also tested Webform 6.3.x with Drupal Core 11 and got the same result.

Steps to reproduce

I used brand-new installations of Drupal and Webform.

1. Add a file element to a Webform, such as a Document File element.
2. View the form and scroll to the file element.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork webform-3614360

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jenna.tollerson created an issue. See original summary.

alanjrl made their first commit to this issue’s fork.

alanjrl changed the visibility of the branch 3614360-allowed-types-list to hidden.

alanjrl changed the visibility of the branch 3614360-allowed-types-list to active.

alanjrl’s picture

Status: Active » Needs review

The comma-delimited Allowed types list was lost when webform_preprocess_file_upload_help() was rewritten in 6.3.x. The old hook rewrote Core's description, while the new one only handles webform_file_limit.

This MR restores the comma-delimited display in WebformManagedFileBase::prepare(). Only the display copy of the FileExtension validator is changed; validation continues to use the space-delimited list required by FileExtensionConstraintValidator.

It also updates getFileExtensions() to remove duplicate separators, preventing values like txt, pdf from rendering as txt, , pdf.