Getting the following issue when trying to select an image or upload and select the new image in the Entity Browser.

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

Image Upload Issue

Please help to resolve this issue.

Comments

sgmanojkumar created an issue. See original summary.

sgmanojkumar’s picture

Title: The entity must be of bundle is displayed after a media is selected on the Entity Media Browser » The entity must be of bundle error message is displayed after a media is selected on the Entity Media Browser
ytsurk’s picture

Seems like a config issue to me.
How is your field configured? What media entity types are allowed?

Actually, the entity browser should be restricted to the allowed media types .. but this might be an issue in RC3,
which won't fix, try to upgrade to 2.0.1!

ytsurk’s picture

Status: Active » Postponed (maintainer needs more info)
mykhailo.levchenko’s picture

HI all. I have the same issue when I try to upload a new SVG. I Will wait for updates on this ticket

ytsurk’s picture

I guess you're on latest 2.0.1 and not RC3 ?

SVGs should definitively be up-loadable (and should notbe using the oEmbedForm). Again seems like a config issue to me.

Do you encounter this in the form widget or the CKEditor Button?

Did you enable the corresponding media entity type for the used widget (in general media directories setting for the form widget, or in the CKEditor button settings when using media_directories_editor).

ytsurk’s picture

ytsurk’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Could you please have a look if the patch in the linked issue solves your problem?

What module do you use for the SVGs?

nitebreed’s picture

Version: 8.x-1.0-rc3 » 2.0.1
Status: Closed (cannot reproduce) » Active

Reopening this ticket since I was encountering the same error on 2.0.1; For me it was happening in the CKEditor embed button. I didn't select any media bundles (since it stated that every bundle would then be available) on the embed button configuration page, and when I uploaded a video in a text editor I couldn't select it and got the error.

After selecting all media bundles, I was able to select the video and embed it in the CKEditor (so that's a workaround for now).

ytsurk’s picture

Assigned: Unassigned » ytsurk

Does the patch here #3248194: Fixes for some combined upload related warnings solve your problem?

Or could you please try with the 2.x-dev version?

I think this should no longer be an issue, but will re-check.

ytsurk’s picture

Version: 2.0.1 » 2.x-dev
Assigned: ytsurk » Unassigned
Status: Active » Needs review
StatusFileSize
new1.64 KB

Alright, I can reproduce by just deselecting all types on the button config.

Here a fix.

  • ytsurk committed da75a72 on 2.x
    Issue #3193549 by ytsurk, sgmanojkumar, Nitebreed: The entity must be of...
ytsurk’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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