FileLinkClassFormatter: possible empty link text with "Use description" option

Created on 21 February 2024, 7 months ago
Updated 29 July 2024, about 2 months ago

Problem/Motivation

When "Use description as link text" is enabled, the File link (with class) formatter uses the contents of description field, even if it is blank, resulting in empty link text.

A description value is not required when the "Use description" setting is enabled. The fallback value should be used when the description is not provided. (IMO, the fallback should be the filename rather than the host entity's label, but that's another issue ✨ FileLinkClassFormatter: use filename for link text Active . πŸ˜‰)

Steps to reproduce

  1. Choose the "File link (with class)" formatter for a file field, and check the "Use description as link text" option.
  2. Add an new entity and provide a file for the field, but do not enter a description
  3. The resulting link to the file will have no text

Proposed resolution

Check for empty description when "Use description" is enabled and use the fallback link text value if appropriate.

Remaining tasks

  • Fix it
  • Test it
  • Deploy it

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States justcaldwell

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