File Share overrides the name of media entity

Created on 30 August 2022, almost 2 years ago
Updated 16 February 2023, over 1 year ago

Problem/Motivation

We want to share media entities, which are PDF files. The name of the files are sanitized (all lower case letters), but the name of the media we want to display is different and more human-readable. If we sync a media entity, two items are synced, a file and a media. The media name, which we want to display, is overwritten by the sanitized file name. This happens in line 134 in PhysicalFile.php.

Steps to reproduce

Create a channel:
langcode: en
status: true
dependencies: {  }
id: media_file
label: 'Media File'
channel_entity_type: media
channel_bundle: file
channel_langcode: und
channel_filters: null
channel_groups: null
channel_sorts: {  }
channel_searches: null
channel_maxsize: 50
access_by_permission: false
authorized_roles: {  }
authorized_users:
  3c0c063f-b541-4bd9-b3b9-71de27e64335: 3c0c063f-b541-4bd9-b3b9-71de27e64335

1. Just create a simple file channel like the one above
2. Go to the target system
3. Just sync one media entity

Two items are synced, and the media name gets overwritten by the file destination.

Proposed resolution

Do not set the file name in the PhysicalFile.php. A better solution is welcome. I am not sure, if this is the best proposal, since I am not 100% familiar with that module.

πŸ› Bug report
Status

Closed: works as designed

Version

3.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany danielspeicher Steisslingen

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

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.69.0 2024