Add a setting to make description a required field for file items

Created on 13 August 2014, over 10 years ago
Updated 9 July 2024, 5 months ago

Problem/Motivation

A site builder is able to allow the user to enter a description for the file field upload. However, in some circumstances, the description may be mandatory. Right now there's no way for a site builder to make the file field upload description mandatory.

Proposed resolution

Add a new setting for file items to require the file description.

Remaining tasks

Updated 5/23/23
See #85 Add a setting to make description a required field for file items Needs work

  1. Framework manager review
  2. Add JavaScript test coverage for #states that support the progressive disclosure
  3. Manual testing
  4. Update the upgrade path tests. Is this addressed by f0a74cb? Or is there more work to do here?
  5. Add REST/JSON:API test coverage
  6. Question from manual testing in #100 Add a setting to make description a required field for file items Needs work : If the description field is required for a media item, should it be available on file upload when you have a Media field?

User interface changes

A new file field setting that allows to enforce the description.

Site builder perspective

End-user perspective

API changes

None.

Data model changes

New, description_field_required, boolean key in the mapping of code>field.field_settings.file schema.

Release notes snippet

As a site builder, on a file field settings form, after checking Enable Description field, check the Require the Description field setting in order to make the file upload required.

Original report

If I add a file field and check Description, I don't get the option to make Description a required field. This results in the public seeing often-unfriendly file names instead of a meaningful description.

Steps: As admin:
1. Edit basic page
2. Add new file field

Actual result: Description is not prechecked
Expected result: Optionally, Description is pre-checked as the public-friendliest solution

3. Check Description

Actual result: No option to require description appears
Expected result: Check box to require description appears. Optionally, it is pre-checked as the public-friendliest solution.

As editor:
1. Add new basic page
2. Attach file
3. Don't fill in Description field
4. Save and publish

Actual result: No error
Expected result: Error

Feature request
Status

Needs work

Version

11.0 🔥

Component
File module 

Last updated 2 days ago

Created by

🇺🇸United States charles belov San Francisco, CA, US

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

Merge Requests

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