Array to string conversion warning when logging is turn to 'Debug'

Created on 25 March 2025, 9 days ago

Problem/Motivation

When I turned ECA log level to "Debug", warning/error message is thrown when triggering events:

Warning: Array to string conversion in Drupal\eca\ConfigurableLoggerChannel->getTokenInfo() (line 236 of modules\contrib\eca\src\ConfigurableLoggerChannel.php).

Drupal\eca\ConfigurableLoggerChannel->getTokenInfo() (Line: 230)
Drupal\eca\ConfigurableLoggerChannel->getTokenInfo() (Line: 230)
Drupal\eca\ConfigurableLoggerChannel->getTokenInfo() (Line: 230)
Drupal\eca\ConfigurableLoggerChannel->getTokenInfo() (Line: 147)
Drupal\eca\ConfigurableLoggerChannel->log() (Line: 87)
Drupal\Core\Logger\LoggerChannel->debug() (Line: 759)
Drupal\eca\Entity\Eca->getSuccessors() (Line: 290)
Drupal\eca\Processor->executeSuccessors() (Line: 222)
Drupal\eca\Processor->execute() (Line: 39)
Drupal\eca\EventSubscriber\DynamicSubscriber->onEvent() (Line: 206)
Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (Line: 56)
Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (Line: 66)
Drupal\eca\Event\TriggerEvent->dispatchFromPlugin() (Line: 119)
Drupal\eca_form\HookHandler::afterBuild()
call_user_func_array() (Line: 1081)
Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 571)
Drupal\Core\Form\FormBuilder->processForm() (Line: 321)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult() (Line: 39)
Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 593)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
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: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->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: 709)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

1. Create a ECA model (I created a model with the "After build form" event)
2. Turn ECA Log Level to "Debug": Administration -> Configuration -> Workflow -> Configure ECA - Events, Conditions, Actions -> Click on "Settings" tab -> select "Debug" from Log Level
3. Trigger the event in the ECA model
4. Warning with the above error message is displayed

I'm using Drupal 11.1.5 and ECA 2.1.6

🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

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

Comments & Activities

  • Issue created by @ikam
  • 🇩🇪Germany jurgenhaas Gottmadingen

    Is this happening with any form or a specific one? I'm asking because I can't reproduce and it may well be that there is something in the form which contains unexpected data types.

    What's required is a more specific way on how this can be reproduced.

  • I think it's happening with a specific form I have. I'll try to identify more details (specifically what on the form is causing this error). Thank you!

  • 🇩🇪Germany jurgenhaas Gottmadingen
  • Hi Jurgen - I've re-tested using the same form that I've been working with, and I cannot re-produce the error. Maybe there was something wrong with my cache or something. But I no longer see the error so maybe we can just close this issue. Thank you!

Production build 0.71.5 2024