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
Comment #2
andikanio commentedComment #3
andikanio commentedComment #4
ytsurkFinally 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.
Comment #6
ytsurk