Doesn't work with Media default settings

Created on 20 February 2024, 11 months ago

Problem/Motivation

By default Media module comes with 4 default bundles Audio, Document, Image, Remote video, Video. And in code bundle "File" is mentioned in the media create function call. Also the default target field is also incorrect. It does not exist by default.

Steps to reproduce

On fresh Drupal 10 setup with this module.
Setup the key and select save as Media checkbox in the augmentor page.
On testing (Preview) you can see it will throw an error of

Error: Call to a member function getSource() on null in Drupal\media\Entity\Media->getSource() (line 143 of /app/web/core/modules/media/src/Entity/Media.php).

Proposed resolution

Either mention in the Readme to create a Media type reflecting the code.
Or Map it to existing media type.

The patch i have provided uses Audio Media type to store the generated file in Media.

Remaining tasks

Review the patch.

User interface changes

None

API changes

None

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇮🇳India saxenaakansha30 New Delhi, India

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

Comments & Activities

Production build 0.71.5 2024