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
- Add paragraph type with the Entity reference media field, with media library widget selected as form display
- Select existing image from the library or choose a new one. Click "Insert Selected"
- Media is not added to the form
- 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.
Comments
Comment #2
vlyalko commentedComment #3
vlyalko commentedComment #4
vlyalko commentedComment #5
vlyalko commentedComment #6
justin2pin commentedThanks 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.
Comment #7
vlyalko commentedjustin2pin, 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.
Comment #8
justin2pin commentedThis 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.