TypeError: count and Warning: Undefined array key

Created on 30 November 2024, 18 days ago

Problem/Motivation

I can't add new entity. There's no problem with edit links.
You can see the error logs below.
Any idea, please. Thanks

TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in count() (line 271 of /var/www/html/d10site/web/modules/contrib/entityconnect/src/Controller/EntityconnectController.php).
Warning: Undefined array key "theme_callback" in Drupal\entityconnect\Controller\EntityconnectController->add() (line 269 of /var/www/html/d10site/web/modules/contrib/entityconnect/src/Controller/EntityconnectController.php)
Warning: Undefined array key "content" in Drupal\entityconnect\Controller\EntityconnectController->add() (line 268 of /var/www/html/d10site/web/modules/contrib/entityconnect/src/Controller/EntityconnectController.php)
The website encountered an unexpected error. Try again later.

TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in count() (line 271 of modules/contrib/entityconnect/src/Controller/EntityconnectController.php).
Drupal\entityconnect\Controller\EntityconnectController->add()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 57)
Drupal\advban\AdvbanMiddleware->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)
💬 Support request
Status

Active

Version

2.0

Component

Code

Created by

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

Comments & Activities

  • Issue created by @pearls
  • gaurav gupta Jaipur, Rajasthsan

    @pearls , Can you please write steps to reproduce . I am not getting any error.
    Thanks.

  • Sorry for the insufficient information.

    I am trying to use entityconnect in storage forms.

    Reference field using select2 form. I also tested with autocomplete or other select widgets
    Even if I change the field form format, the following error occurs.

    Warning: foreach() argument must be of type array|object, string given in Drupal\entityconnect\EntityconnectFormUtils::validateForm() (line 101 of modules/contrib/entityconnect/src/EntityconnectFormUtils.php).
    

    Could the problem be because I'm using custom entity(storage) instead of node type?

    Thanks for support.

Production build 0.71.5 2024