File in EntityBrowserFormTrait not loading file name

Created on 13 May 2025, about 2 months ago

Problem/Motivation

In the function processEntityBrowserSelected, on this condition:

if ($entity_type_manager->hasHandler($entity_type_id, 'view_builder')) {
        $preview = $entity_type_manager->getViewBuilder($entity_type_id)->view($entity, $element['#view_mode']);
      }
      else {
        $preview = ['#markup' => $entity->label()];
      }

It's entering on the first if. The problem is that as far as I know, files don't have view modes (or at least I can't configure them for files in admin/structure/display-modes/view), so there should be an extra condition so it would enter instead inside the else.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇪🇸Spain guardiola86

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024