Fatal error when trying to use File browser

Created on 8 November 2021, about 3 years ago
Updated 22 April 2024, 8 months ago

Problem/Motivation

Error: Cannot use object of type Drupal\Core\Entity\Entity\EntityFormDisplay as array in Drupal\filefield_sources\Controller\ImceController->page() (line 45 of modules/contrib/filefield_sources/src/Controller/ImceController.php).

Steps to reproduce

After enabling the module, at vanilla Drupal, access admin/structure/types/manage/article/form-display, click on the gear icon or "Widget Settings" of the image field & under "FILE SOURCES" enable "IMCE file browser" & save the configuration.

Proposed resolution

https://git.drupalcode.org/project/filefield_sources/-/blob/8.x-1.x/src/... code here should call the specific component, instead of the whole form display.

Remaining tasks

Provide a patch.

πŸ› Bug report
Status

RTBC

Version

2.0

Component

Source: IMCE

Created by

πŸ‡ΊπŸ‡ΈUnited States rishi kulshreshtha

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡«πŸ‡·France aiphes

    Hello,

    Facing the same on D9.5.3 + filefield_sources versions : * 1.x-dev, with:

    The website encountered an unexpected error. Please try again later.
    Error: Cannot use object of type Drupal\Core\Entity\Entity\EntityFormDisplay as array in Drupal\filefield_sources\Controller\ImceController->page() (line 45 of modules/contrib/filefield_sources/src/Controller/ImceController.php).
    Drupal\filefield_sources\Controller\ImceController->page('node', 'fiche_bts', 'field_detail_fiche_bts', Object)
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 182)
    Drupal\cleantalk\EventSubscriber\BootSubscriber->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
    Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

    Do I need to patch ?
    Thanks

  • πŸ‡ΊπŸ‡ΈUnited States rschwab

    +1 for RTBC. This fixes the error. Also changing to 2.x-dev to target D10, though this issue does still exist on the 8.x branch.

Production build 0.71.5 2024