Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Entity browser itself provides "Upload" plugin that operates with files. It would be great to have an upload plugin that would work with media entity.
Proposed resolution
Extend original "upload" plugin to work with media entity images.
Let's think how to use dropzone.js or jquery file upload with this EB widget (and uploads in general).
Comment | File | Size | Author |
---|---|---|---|
#5 | 2512720-5-upload-conf.patch | 3.21 KB | DeFr |
Comments
Comment #1
slashrsm CreditAttribution: slashrsm commentedComment #2
slashrsm CreditAttribution: slashrsm commentedComment #3
DeFr CreditAttribution: DeFr at Axess Open Web Services commentedNote: An embed plugin got added in July. That being said, it's laking most of the configuration options in the Entity Browser creation UI, which makes it a bit hard to use.
Working on fixing that as a first step, so assigning myself. Patch coming up soonish.
Comment #4
DeFr CreditAttribution: DeFr at Axess Open Web Services commentedHad to take an unexpected break, so it took a bit longer than planned, but here it is.
I'm still wondering about a few things in this patch though:
Thought about those two points more than welcome.
(Sidenote: also converted two remaining t() call to $this->t() , thought it wasn't worth it's own dedicated issue, but can be split if you want)
Comment #5
DeFr CreditAttribution: DeFr at Axess Open Web Services commentedLooks like it was late on Friday, not sure how I missed the fact that the source field type was a property of the media bundle… Replaced the loadMultiple by a loadByProperties, which will avoid loading bundles unnecessarily.
Also thought a bit more about the first point during the week-end, and maybe the correct fix would be to expand EntityBrowser WidgetInterface slightly, adding a method to check if a specific plugin should be available or not in the list based on the current site configuration. The View widget could use it to hide itself if there's no view with an entity_browser_display available, and ME image upload plugin could hide itself if there's no image bundle.
Comment #7
slashrsm CreditAttribution: slashrsm at MD Systems GmbH commentedCommitted. Added comment block above the function along the way.
Thanks!