Problem/Motivation

The Media Library Widget is not working. See comment#6.

Proposed resolution

Recover the filed type (linked_entity_reference) and remove widget if Media Library is not enabled to avoid a dependency on it,.

Original report below

The readme says

"Configure the form display. There are 2 widgets provided:
Autocomplete: Supported when referencing all entity types.
Media library: Supported when referencing media entities

There is no field type defined for 'linked_media_library'.

There is for 'linked_entity_reference'.

Steps to reproduce

Install the module, link to a media field.

Proposed resolution

The widget exists. src/Plugin/Field/FieldWidget/LinkedMediaLibrary.php

Or apply the widget to the existing media reference? Is a new field required to enable storage of the link as opposed to MediaThumbnailFormatter.php.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

interlated created an issue. See original summary.

interlated’s picture

Issue summary: View changes
tunic’s picture

There is no field 'linked_media_library'.

I 'm not sure what this means. If you mean that you expect the module to create a linked_media_library field, that is not the case for this module. The user should create the field as needed. The module just provides the widgets and behaviour so it can be added to a field.

If this is not what you meant I would need more info to fully understand the problem.

interlated’s picture

There is a field type with id = "linked_entity_reference",

There is none for "linked_media_library".

I can't create a new field of the type linked_media_library as described in the notes.

interlated’s picture

Issue summary: View changes
tunic’s picture

Title: There is no field 'linked_media_library' » The linked_media_library widget is not working
Assigned: Unassigned » tunic
Category: Feature request » Bug report
Priority: Normal » Major
Issue summary: View changes

Ok, I see the problem. During #3358368: Drupal 10 compatibility fixes the linked_media_library widget was changed: the field type it can be applied to changed from linked_entity_reference to linked_media_library. This was to solve an error apparently due to Drupal 10 compatibility, although it was just because Media Library module was not enabled. Changing the field type to something non-existent "solved" the issue because the widget was not processed anymore.

The problem should be solved removing the widget if the Media Library module is not found.

tunic’s picture

Assigned: tunic » Unassigned

I think is fixed, can you try the dev version with the fix?

tunic’s picture

tunic’s picture

Status: Active » Fixed

Fixed in 1.0.1.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.