Problem/Motivation

When using the Front end editing (Gesso theme in our case) and the Layout Paragraph widget is configured for a taxonomy term's form mode, a user cannot add paragraph with the media field with form display widget set to media library widget. When choosing a media or adding a new one selected, clicking Media Library "Insert Selected" results in nothing happening. Modal window closed and no media added to the form.

Steps to reproduce

  1. Add paragraph type with the Entity reference media field, with media library widget selected as form display
  2. Select existing image from the library or choose a new one. Click "Insert Selected"
  3. Media is not added to the form
  4. If change Paragraph media field display widget to any other type, like select or autocomplete, media item is being added to the form and user is able to save it on the form.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

vlyalko created an issue. See original summary.

vlyalko’s picture

Issue summary: View changes
vlyalko’s picture

Issue summary: View changes
vlyalko’s picture

Issue summary: View changes
vlyalko’s picture

Title: Unable to add image using media library widget on a taxonomy term form when using the Gesso theme » Unable to add image using media library widget on a taxonomy term form when using the Front End editing
justin2pin’s picture

Status: Active » Needs work

Thanks for this - confirmed this is an issue with Layout Paragraphs and Media Library. The root issue appears to be that both modules are using the OpenModalDialog command, and only one modal can be opened at a time. The Media Library modal overwrites / removes the LP one.

vlyalko’s picture

justin2pin, thank you for the clue. I have found an issue created for the core related to the issue we have here: "Nested modals don't work: opening a modal from a modal closes the original". https://www.drupal.org/project/drupal/issues/2741877
I have applied the this patch: https://www.drupal.org/project/drupal/issues/2741877#comment-13563283, because someone mentioned it worked for 9.1 drupal core version and it fixed the issue with nested modals when adding image via media library. I will try the latest patch as well.

justin2pin’s picture

This should be fixed. Like other contributors on #2741877: Nested modals don't work: opening a modal from a modal closes the original, I opted to use "dialog" instead of "modal" to prevent compatibility issues with other modules. Please re-open if you notice other issues.

Status: Fixed » Closed (fixed)

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