Closed (fixed)
Project:
Entity Browser
Version:
8.x-2.x-dev
Component:
Field widget
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
18 Sep 2019 at 09:55 UTC
Updated:
26 Dec 2019 at 18:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
primsi commentedInitial patch, not test yet. I think we don't have anything that could be just extended easily.
Comment #3
arpad.rozsa commentedEntity browser works with entities other than media so this check is not needed.
For the test I found the EntityReferenceWidgetTest would work, so I added the assert there to check if the contextual links don't exist on the page.
Comment #4
berdirWhat about render-caching?
If the same view mode is used in a different context than entity browser then it would also not show contextual links there.
You can fix that by adding an extra 'entity_browser' key to $build['#cache']['keys']
you don't need to repeat modules from the parent, just add which module you need additionally.
Comment #5
arpad.rozsa commentedAdded the cache key and removed the modules list from the test that you suggested.
Comment #6
berdirI guess it could be argued that having those links there is useful in some cases, but unless your users are experienced and know that they need to open these links in a new tab it could easily lead to data loss.. similar to links in node previews and so on.
Setting to RTBC to get the attention of @oknate and whoever else has an opinion on it, if not sure we could maybe add a setting for it?
Comment #7
oknateI think if someone wants them, they can use widget alter. I think this is good to go.
Comment #8
oknateActually, we may want to use
$build['#contextual_links']['#access'] = FALSE, instead ofunset($build['#contextual_links']);It would be easier to override in other modules in hook_entity_view_alter().
Comment #9
oknateAh, I see, it's not a build array at this point.
Comment #12
oknateCommitted, thanks!
🎉