Reproducible every time I've set up an image field using
* a media bundle as Entity Reference,
* using Entity Browser as widget,
there is no View Mode option in entity browser widget settings on form display (screenshot).

Entering content in this field was temporarily resulting in this error (with more error text following), either on the edit screen or on the page having been saved, or originally upon saving the content type:
Undefined index: view_mode in Drupal\entity_browser\Plugin\EntityBrowser\FieldWidgetDisplay\RenderedEntity->view() (line 75 of PATH_TO/modules/entity_browser/src/Plugin/EntityBrowser/FieldWidgetDisplay/RenderedEntity.php)
This is happening using paragraphs or not.
The odd thing is the error has usually disappeared after cache clearing voodoo, and it is currently gone, but the blank view mode remains. I've been working with this for a while, and don't find anything substantial reported on this.
Any help in tracking down the cause will be greatly appreciated!
| Comment | File | Size | Author |
|---|---|---|---|
| no-view-mode-entity-browser-widget.png | 53.8 KB | echoz |
Comments
Comment #2
echoz commentedComment #3
echoz commentedI resolved this by adding a view mode of entity type Media for which there was none. Seems like there would have been a default one there created by Media entity image. Even though the errors stopped, it haunted me having that blank View mode select, and the possible return of the errors.
I still question the difference of these entity references using type image or type file.