Deprecated function: trim(): Passing null to parameter #1

Created on 28 November 2022, over 1 year ago
Updated 7 August 2023, 11 months ago

Problem/Motivation

Installing on Drupal 9.4 running on PHP 8.1 gave the error:
Deprecated function: trim(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\opcachectl\Access\OpcacheCtlAccess->__construct() (line 45 of modules/contrib/opcachectl/src/Access/OpcacheCtlAccess.php).

Backtrace:

#0 /home/peter/www/html/raynet-sim/public_html/core/includes/bootstrap.inc(347): _drupal_error_handler_real()
#1 [internal function]: _drupal_error_handler()
#2 /home/peter/www/html/raynet-sim/public_html/modules/contrib/opcachectl/src/Access/OpcacheCtlAccess.php(45): trim()
#3 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(262): Drupal\opcachectl\Access\OpcacheCtlAccess->__construct()
#4 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(176): Drupal\Component\DependencyInjection\Container->createService()
#5 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Core/Access/CheckProvider.php(100): Drupal\Component\DependencyInjection\Container->get()
#6 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Core/Access/CheckProvider.php(132): Drupal\Core\Access\CheckProvider->loadCheck()
#7 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Core/Access/CheckProvider.php(85): Drupal\Core\Access\CheckProvider->applies()
#8 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Core/Routing/RouteBuilder.php(191): Drupal\Core\Access\CheckProvider->setChecks()
#9 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php(83): Drupal\Core\Routing\RouteBuilder->rebuild()
#10 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Core/Extension/ModuleInstaller.php(377): Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild()
#11 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(83): Drupal\Core\Extension\ModuleInstaller->install()
#12 /home/peter/www/html/raynet-sim/public_html/core/modules/system/src/Form/ModulesListForm.php(502): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install()
#13 [internal function]: Drupal\system\Form\ModulesListForm->submitForm()
#14 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Core/Form/FormSubmitter.php(114): call_user_func_array()
#15 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Core/Form/FormSubmitter.php(52): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers()
#16 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Core/Form/FormBuilder.php(592): Drupal\Core\Form\FormSubmitter->doSubmitForm()
#17 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Core/Form/FormBuilder.php(320): Drupal\Core\Form\FormBuilder->processForm()
#18 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
#19 [internal function]: Drupal\Core\Controller\FormController->getContentResult()
#20 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#21 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#22 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#23 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#24 /home/peter/www/html/raynet-sim/vendor/symfony/http-kernel/HttpKernel.php(159): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#25 /home/peter/www/html/raynet-sim/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#26 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#27 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#28 /home/peter/www/html/raynet-sim/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#29 /home/peter/www/html/raynet-sim/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#30 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#31 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#32 /home/peter/www/html/raynet-sim/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#33 /home/peter/www/html/raynet-sim/public_html/core/lib/Drupal/Core/DrupalKernel.php(709): Stack\StackedHttpKernel->handle()
#34 /home/peter/www/html/raynet-sim/public_html/index.php(19): Drupal\Core\DrupalKernel->handle()
#35 {main}

Steps to reproduce

Clean site.
Install using composer: composer require 'drupal/opcachectl:^2.0@alpha'

Extend > install

On the clean site, I got the message immediately after install (the install succeeded).
On the existing site, I got it when I when to /admin/config/system/opcache

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom jprj

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.

Production build 0.69.0 2024