silverstripe / silverstripe-linkfield

Silverstripe module for managing links
BSD 3-Clause "New" or "Revised" License
4 stars 14 forks source link

FileLink default text link should be the File Title #240

Closed maxime-rainville closed 4 months ago

maxime-rainville commented 4 months ago

Module version(s) affected

4.x-dev

Description

File Link should use the File title as their default title. It's currently using the Filename including the path.

image

How to reproduce

  1. Add a link to file.
  2. Do not provide Link text.
  3. Save your link text

Expected results: the Title of the link matches the title of the file. Actual: The Filename of the File is the Title of the link

Possible Solution

Fix this line: https://github.com/silverstripe/silverstripe-linkfield/blob/b6dcef0a273e43267ed1f608c461414bf7c716af/src/Models/FileLink.php#L53

Acceptance criteria

Additional Context

No response

Validations

PR

maxime-rainville commented 4 months ago

This should be trivial to fix, but I'm putting it in Refinement first to give people a chance to disagree with me.

GuySartorelli commented 4 months ago

PR merged