FileItem::generateSampleValue() should generate files with the actual allowed extensions

Created on 13 August 2015, almost 10 years ago
Updated 19 June 2025, about 1 month ago

Problem/Motivation

FileItem::generateSampleValue() hard-codes to generating txt files. If I have a file field that doesn't allow txt files, this is creating unwanted values.

Proposed resolution

Honor the field configuration's file_extensions setting and only generate sample files with allowed extensions.

Remaining tasks

  1. See #30
  2. Review.
  3. Commit.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component

file.module

Created by

πŸ‡ΊπŸ‡ΈUnited States dave reid Nebraska USA

Live updates comments and jobs are added and updated live.
  • Contributed project blocker

    It denotes an issue that prevents porting of a contributed project to the stable version of Drupal due to missing APIs, regressions, and so on.

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