External Media title field is mapped to the file url

Created on 14 October 2022, almost 2 years ago
Updated 19 July 2023, about 1 year ago

Problem/Motivation

The external media title field is mapped to photu url, due to which the name of the media entity after import is getting added with photo url.

Steps to reproduce

Step 1: Create external media entity with unsplash media source.
Step 2: Add this media type as an entity reference to any content type.
Step 3: Add a media on the content type and search for an image on unsplash via the entity browser interface.
Step4: Select one image from the search results & click import.
Step 5: Check the name in the entity browser interface after the import, the name field will be populated with some random string as if its a url.

Proposed resolution

Update the external media class and in `getmetadata() function under switch case change the title field mapping from `$photo->geturl()` to `$photo->getDescription()` as the name id coming in description field from unsplash as per my understanding.

🐛 Bug report
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

🇮🇳India tdnshah

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.

  • 🇳🇱Netherlands seanB Netherlands

    After thinking about this, I'm going to close this as won't fix. There are several ways to already solve this:

    1. You can map the name field for a media type to whatever you want, in this case the description/alt text.
    2. The description/alt text can already be searched by updating the view to have a search field that searches more fields.
    3. Work is being done in Add a hook to modify oEmbed resource data Needs work to allow sites to alter the metadata generically, which seems to be a better solution.
Production build 0.71.5 2024