Media documents with unlimeted files have a wrong link

Created on 4 March 2025, 29 days ago

Problem/Motivation

When using a media document with the cardinality set to unlimited. Only the first file link to download works. All the following files have the wrong link.

Steps to reproduce

Go to /admin/structure/media/manage/document/fields
Click to edit the Document(field_media_document) /admin/structure/media/manage/document/fields/media.document.field_media_document
Set this field as unlimited and save.
Create a node that uses the document media field and add more than one file.
Access the view node and try to download the files.
This is how the link at the second position is displayed.

With the wrong parameter, the controller doesn't handle the delta downloading the first file of the list.

Proposed resolution

Fix the variable at DownloadLinkFieldFormatter::viewElements line 100 to $url_options instead of $route_parameters.
This bug seems like a typo or merge error.
Whatever, I'm attaching a proposal fix.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇧🇷Brazil joaopauloc.dev

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