strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated

Created on 19 May 2023, over 1 year ago
Updated 25 January 2024, 11 months ago

Problem/Motivation

I found these errors in the log system. We are now not able to connect to the status page or the configuration page.

Deprecated function: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in Drupal\tome_static\StaticGenerator->requestPath() (line 180 of /var/www/html/web/modules/contrib/tome/modules/tome_static/src/StaticGenerator.php)
#0 /var/www/html/web/core/includes/bootstrap.inc(158): _drupal_error_handler_real(8192, 'strpos(): Passi...', '/var/www/html/w...', 180)
#1 [internal function]: _drupal_error_handler(8192, 'strpos(): Passi...', '/var/www/html/w...', 180)
#2 /var/www/html/web/modules/contrib/tome/modules/tome_static/src/StaticGenerator.php(180): strpos(NULL, 'text/html')
#3 /var/www/html/web/modules/contrib/tome/modules/tome_static/src/Form/StaticGeneratorForm.php(198): Drupal\tome_static\StaticGenerator->requestPath('/ru/search')
#4 /var/www/html/web/core/includes/batch.inc(295): Drupal\tome_static\Form\StaticGeneratorForm->exportPath('/ru/search', 'https://main.d2...', Array)
#5 /var/www/html/web/core/includes/batch.inc(137): _batch_process()
#6 /var/www/html/web/core/includes/batch.inc(93): _batch_do()
#7 /var/www/html/web/core/modules/system/src/Controller/BatchController.php(55): _batch_page(Object(Symfony\Component\HttpFoundation\Request))
#8 [internal function]: Drupal\system\Controller\BatchController->batchPage(Object(Symfony\Component\HttpFoundation\Request))
#9 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#10 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#11 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#12 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#13 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(163): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#14 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(74): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#15 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(686): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#24 {main}

Steps to reproduce

Drupal 10...
tome_static :Version: 8.x-1.11

settings.php file includes...
$settings['tome_static_directory'] = '../tome/multisite1.com';
$settings['tome_static_path_exclude'] = ['/node','/admin','/taxonomy'];

🐛 Bug report
Status

Fixed

Version

1.0

Component

Tome Static

Created by

🇬🇧United Kingdom aesuk

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024