Deprecated function errors, possibly related to PHP 8.1

Created on 4 July 2023, over 1 year ago
Updated 20 June 2024, 5 months ago

Problem/Motivation

Drupal 9.5.9, PHP 8.1.18
When I go to theme settings page for generated theme I see multiple errors re strlen() and str_replace():

Deprecated function: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in Drupal\Component\Utility\Xss::filter() (line 69 of /home/dcappeals/public_html/core/lib/Drupal/Component/Utility/Xss.php)

#0 /home/dcappeals/public_html/core/includes/bootstrap.inc(347): _drupal_error_handler_real()
#1 [internal function]: _drupal_error_handler()
#2 /home/dcappeals/public_html/core/lib/Drupal/Component/Utility/Xss.php(69): str_replace()
#3 /home/dcappeals/public_html/themes/contrib/adaptivetheme/at_core/forms/ext/fonts.php(170): Drupal\Component\Utility\Xss::filter()
#4 /home/dcappeals/public_html/themes/contrib/adaptivetheme/at_core/forms/ext/extension_settings.php(222): include_once('...')
#5 /home/dcappeals/public_html/themes/contrib/adaptivetheme/at_core/theme-settings.php(167): require_once('...')
#6 /home/dcappeals/public_html/core/modules/system/src/Form/ThemeSettingsForm.php(379): at_core_form_system_theme_settings_alter()
#7 [internal function]: Drupal\system\Form\ThemeSettingsForm->buildForm()
#8 /home/dcappeals/public_html/core/lib/Drupal/Core/Form/FormBuilder.php(536): call_user_func_array()
#9 /home/dcappeals/public_html/core/lib/Drupal/Core/Form/FormBuilder.php(283): Drupal\Core\Form\FormBuilder->retrieveForm()
#10 /home/dcappeals/public_html/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
#11 [internal function]: Drupal\Core\Controller\FormController->getContentResult()
#12 /home/dcappeals/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#13 /home/dcappeals/public_html/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#14 /home/dcappeals/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#15 /home/dcappeals/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#16 /home/dcappeals/public_html/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#17 /home/dcappeals/public_html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#18 /home/dcappeals/public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#19 /home/dcappeals/public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#20 /home/dcappeals/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#21 /home/dcappeals/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#22 /home/dcappeals/public_html/modules/contrib/services/src/StackMiddleware/FormatSetter.php(44): Drupal\page_cache\StackMiddleware\PageCache->handle()
#23 /home/dcappeals/public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\services\StackMiddleware\FormatSetter->handle()
#24 /home/dcappeals/public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#25 /home/dcappeals/public_html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#26 /home/dcappeals/public_html/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle()
#27 /home/dcappeals/public_html/index.php(19): Drupal\Core\DrupalKernel->handle()
#28 {main}

Steps to reproduce

1. Created a subtheme using AT_Theme_Generator
2. Install theme as defualt
3. Go to theme settings page for new theme

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

RTBC

Version

7.0

Component

Theme Settings

Created by

🇺🇸United States rsbecker

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

Comments & Activities

Production build 0.71.5 2024