Trim trailing whitespace in title

Created on 10 March 2025, 30 days ago

Problem/Motivation

When the title in the xml has a trailing whitespace character this remains part of the title. This caused an issue when we used the title in a twig template for different attributes (id and data-modal-toggle). I am not sure why, but the data-modal-toggle attribute ended in a '-' character, but the id had the whitespace trimmed, even though we used the same twig filters. The result was that the modal would nog longer open without adding a trim filter.

It seems cleaner to trim the title upon reading it from the xml instead of fixing it later.

Steps to reproduce

(1) Upload an xml with a trailing whitespace in the title and save the media item. (E.g.,: Lorum ipsum )
(2) Go back to the edit page and see that the whitespace is at the end of the title.

Proposed resolution

We can use the trim() function to remove the trailing whitespace.

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

1.0

Component

Code

Created by

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