Invalid argument supplied for foreach() in Drupal\Core\Field\FormatterPluginManager

Created on 15 December 2020, over 3 years ago
Updated 17 February 2023, over 1 year ago

Hello,

I face off issues about PHP:

Warning : Invalid argument supplied for foreach() dans Drupal\Core\Field\FormatterPluginManager->getOptions() (/var/www/drupal-8/core/lib/Drupal/Core/Field/FormatterPluginManager.php ligne 176)
#0 /var/www/drupal-8/core/includes/bootstrap.inc(600): _drupal_error_handler_real(2, 'Invalid argumen...', '/var/www/drupal...', 176, Array)
#1 /var/www/drupal-8/core/lib/Drupal/Core/Field/FormatterPluginManager.php(176): _drupal_error_handler(2, 'Invalid argumen...', '/var/www/drupal...', 176, Array)

and Js:
Hook de thรจme token_tree non trouvรฉ with Seven as admin theme

and this cause:
Filefield sources autocomplete doesn't work anymore
Megamenu doesn't show sub items depending on which page you are

I don't have enough element to know what I need to look for.

Thanks for help

๐Ÿ› Bug report
Status

Postponed: needs info

Version

10.1 โœจ

Component
Pluginย  โ†’

Last updated 8 days ago

Created by

๐Ÿ‡ซ๐Ÿ‡ทFrance aiphes

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

    Still on D9.5.2:

    Message	Warning : foreach() argument must be of type array|object, null given dans Drupal\Core\Field\FormatterPluginManager->getOptions() (/home/xxx/www/xxx/sited9/web/core/lib/Drupal/Core/Field/FormatterPluginManager.php ligne 176)
    #0 /home/xxx/www/xxx/sited9/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real(2, 'foreach() argum...', '/home/provence-...', 176)
    #1 /home/xxx/www/xxx/sited9/web/core/lib/Drupal/Core/Field/FormatterPluginManager.php(176): _drupal_error_handler(2, 'foreach() argum...', '/home/provence-...', 176)
    #2 /home/xxx/www/xxxx/sited9/web/core/modules/field_ui/src/Form/EntityDisplayFormBase.php(755): Drupal\Core\Field\FormatterPluginManager->getOptions('language')
  • Status changed to Postponed: needs info over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States cilefen

    I read over this issue carefully. It is a bug report, but the bug report lacks detailed steps to reproduce that community contributors can follow to solve the problem. This will not be solved without more information.

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance aiphes

    Hello.
    What kind of infos do you need more ? I guess it could be related to my 500 errors as authentified user.

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance aiphes

    Another error:

    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)
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance aiphes

    Steps to reproduce:
    1- Migrate website to D8 or D9 from D6, with CCK managed fields
    2- Edit the "admin/structure/types/manage/TYPE/form-display", and enable or disable field about language or metatag
    3- Then go to edit a node of this type, and this lead to 500 error ( view mode for authentificated user) or error message

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States cilefen

    That stack trace points to an issue in module filefield_sources, not Drupal core.

    It would be nice to have a stack trace for the error that this issue seems to be about. This is what I meanโ€”this issue lacks focus.

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance aiphes

    Will see on filefield_sources side so.

Production build 0.69.0 2024