PHP 8.1 Warning: Array to string conversion

Created on 27 November 2023, about 1 year ago
Updated 31 December 2023, 12 months ago

Problem/Motivation

I run a security review and the logs filled with
PHP Warning: Array to string conversion

Warning: Array to string conversion in Drupal\security_review\Checks\QueryErrors->run() (line 68 of /var/www/example.com/web/modules/contrib/security_review/src/Checks/QueryErrors.php)
#0 /var/www/example.com/web/core/includes/bootstrap.inc(164): _drupal_error_handler_real()
#1 /var/www/example.com/web/modules/contrib/security_review/src/Checks/QueryErrors.php(68): _drupal_error_handler()
#2 /var/www/example.com/web/modules/contrib/security_review/src/Checklist.php(168): Drupal\security_review\Checks\QueryErrors->run()
#3 /var/www/example.com/web/modules/contrib/security_review/security_review.module(199): Drupal\security_review\Checklist->runChecks()
#4 /var/www/example.com/web/core/includes/batch.inc(296): _security_review_batch_run_op()
#5 /var/www/example.com/web/core/includes/batch.inc(138): _batch_process()
#6 /var/www/example.com/web/core/includes/batch.inc(94): _batch_do()
#7 /var/www/example.com/web/core/modules/system/src/Controller/BatchController.php(49): _batch_page()
#8 [internal function]: Drupal\system\Controller\BatchController->batchPage()
#9 /var/www/example.com/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#10 /var/www/example.com/web/core/lib/Drupal/Core/Render/Renderer.php(592): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#11 /var/www/example.com/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#12 /var/www/example.com/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#13 /var/www/example.com/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#14 /var/www/example.com/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#15 /var/www/example.com/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#16 /var/www/example.com/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#17 /var/www/example.com/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#18 /var/www/example.com/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#19 /var/www/example.com/web/core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle()
#20 /var/www/example.com/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle()
#21 /var/www/example.com/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#22 /var/www/example.com/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#23 /var/www/example.com/web/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#24 /var/www/example.com/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#25 {main}

Is it a problem on my setup ?

Steps to reproduce

Run a security review on a system with php 8.1.26 and Drupal 10.1.6

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡¬πŸ‡·Greece pappis Greece

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024