Problem/Motivation

InvalidArgumentException: Can only add media types which use an oEmbed source plugin. in Drupal\media_directories_ui\Form\OEmbedForm->getMediaType() (line 79 of modules/contrib/media_directories/modules/media_directories_ui/src/Form/OEmbedForm.php).

Steps to reproduce

1. install module - https://www.drupal.org/project/garden_gnome_package
2. add a new media type with garden gnome
3. add a media field in a block using garden gnome
4. use Media Directories: field widget form
5. can't add Media, because it fallback to OEmbedForm instead of FileUploadForm

Current solution from me

in media_directories_ui.module line 244-249,
Switch the else to use "FileUploadForm" instead of the if

OR

add ggnome_file in the if statement on line 244

Comments

andikanio created an issue. See original summary.

andikanio’s picture

Issue summary: View changes
andikanio’s picture

StatusFileSize
new1008 bytes
ytsurk’s picture

Title: Integration with Garden Gnome Media Type » Sophisticated OEmbed switch
Version: 2.0.1 » 2.x-dev
Category: Support request » Bug report
Status: Active » Needs review
StatusFileSize
new1.6 KB

Finally coming back to this OEmbed issue.
Thank you for your patch already pointing in the right direction.

The string checks seems good, but I prefer looking at the deriver. Hopefully this will solve this issue ...
We also can strip the invokation of entity manager this way.

  • ytsurk committed c3f9112 on 2.x
    Issue #3219025 by andikanio, ytsurk: Sophisticated OEmbed switch
    
ytsurk’s picture

Status: Needs review » Fixed

  • ytsurk committed b7eb4b5 on 2.x
    Issue #3219025 by ytsurk: Re-throw FormAjaxException
    

Status: Fixed » Closed (fixed)

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