Postponed (maintainer needs more info)
Project:
Entity Browser
Version:
8.x-2.2
Component:
Widget plugins
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Anonymous (not verified)
Created:
7 Dec 2016 at 16:07 UTC
Updated:
25 Aug 2026 at 12:53 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedDeraynger created an issue. See original summary.
Comment #2
keesje commentedThis might be caused by a "media_entity" bug: https://www.drupal.org/node/2836423
Comment #3
Anonymous (not verified) commented@keesje Unfortunately that doesn't solve the problem in my case.
Comment #4
keesje commentedok. since entity_browser is just a widget to select a reference, I doubt that this module is the source of your problem.
Comment #5
keesje commentedTry this alternative formatter for your images: https://www.drupal.org/node/2749695#comment-11843530
As I found out the "Thumbnail" formatter is not designed to be used for content display.
Comment #6
slashrsm commentedImage media entities can't work with core image field. Could you elaborate a bit on that?
Are you using Lightning? They do something like that, but you have to note that the media entity is not used in that case as the raw image from it is extracted and used in the field.
Comment #7
Anonymous (not verified) commentedYes, I'm using lightning and using the browser to select the media image.
Comment #8
Anonymous (not verified) commentedBasically this is how I see it, the media has an image. A content type, say page, has an image field too. We add the media image browser to select an image for the page. The image of the media gets selected, but the attributes (Alt and/or Title) used on that image aren't applied, meaning that this data must be set again.
A workaround could be to use the media directly, which would mean rendering the media on the page, so it would require the media to contain all the view modes that the page has, in order to render the various image styles correctly.
Hope that made sense. I still think the media browser module would do so the data set on the media image file would just be copied over to the image of the page.
Comment #9
Anonymous (not verified) commentedComment #10
keesje commented"field_formatter" module could be your friend. more on this: #2749695-11: Thumbnail not updated
Comment #11
balra06 commentedHi ,
I am also facing the similar issue in my Drupal Site.
I have an Image Field which uses Entity Browser as the Widget.
Select Image Option in the Image Field opens up the Entity Browser and when i try to upload an image by giving Alt text to it and save it, the alt text is not getting back to the Image field and it expects to enter the alt text and title again
Do we have any solution for this ?
Thanks,
Radha.
Comment #12
leisurman commentedLooking for an answer too.
Comment #13
rromore commentedI've dug in a bit and in my case, I believe the issue is because the $entity variable set at FileBrowserWidget.php:246 is of type File, which doesn't hold the alt text information. I've created a patch that looks for the alt text (and title text) on referencing entities. Not sure if this is the best approach but it seems to work. I'm using Drupal 8.6.3, Entity Embed 8.x-1.0-beta2, and Entity Browser 8.x-1.x.
Comment #14
rromore commentedUpdated previous patch with some fixes (replacing the hardcoded reference entity key with the variable).
Comment #15
abhijeet.kumar2107 commentedI applied Patch #14 and working fine.
Below steps after applying patch
Comment #16
abhijeet.kumar2107 commentedComment #17
abhijeet.kumar2107 commentedComment #18
abhijeet.kumar2107 commentedComment #19
sourabhutani commentedPatch working fine for me. Thanks
Comment #20
visway12 commentedI tried the Patch #14 in version 8.x-2.2 and it failed, so re-wrote the patch to support 8.x-2.2 version and it worked for me.
Comment #23
samlerner commentedThe patch stopped applying, and since it's the year 2024, I created an MR and a pull request out of the patch. Looks to be working well, could use a review.
Comment #24
ptkoroma commentedReviwed and patch working fine for me.
Comment #25
samlerner commentedMoving to RBTC.
Comment #26
berdirIt's quite unclear to me why this there is a use case of mixing direct file selection *and* media referenced, I would assume you'd use either one or the other. I can see it with multiple direct references to files from nodes, but limiting this specifically to media seems strange.
I suggest updating the issue summary with updated instructions on the use case around this and why it should be limited to nodes.
Also, the code should be more careful to verify that the reference is correct and the field exists, with things like revisions and multi-value fields, it might not actually select the media you think it does.
Comment #27
esolano commentedRe-rolling patch to make it compatible with Drupal 10.3
Comment #28
anybodyAs of #26
Comment #29
diego sabolo commentedI've updated the patch to work with Entity Browser 2.17.0.
The previous patch (#27) was created for an older version and no longer applies cleanly. This updated patch:
- Adapts the code to match the current structure in 2.17.0
- Adds the EntityStorageInterface use statement
- Implements the same functionality: inheriting alt text and title from media entities when using Entity Browser
Tested on:
- Drupal 11.4.5
- Entity Browser 2.17.0
The patch successfully applies and allows alt text/title to be inherited from media entities.