When saving settings: Deprecated function: json_decode()

Created on 15 November 2023, about 1 year ago
Updated 10 September 2024, 2 months ago

When saving the module config settings after updating to version 9.3, I am consistently getting this error

Deprecated function: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in Cleantalk\Custom\Antispam\Cleantalk->httpRequest() (line 441 of /var/www/html/web/modules/contrib/cleantalk/lib/Cleantalk/Custom/Antispam/Cleantalk.php)

URL: admin/config/cleantalk/cleantalk_settings_form

Drupal 9.5.11 with PHP 8.1.22

Deprecated function: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in Cleantalk\Custom\Antispam\Cleantalk->httpRequest() (line 441 of /var/www/html/web/modules/contrib/cleantalk/lib/Cleantalk/Custom/Antispam/Cleantalk.php)
#0 /var/www/html/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real(8192, 'json_decode(): ...', '/var/www/html/w...', 441)
#1 [internal function]: _drupal_error_handler(8192, 'json_decode(): ...', '/var/www/html/w...', 441)
#2 /var/www/html/web/modules/contrib/cleantalk/lib/Cleantalk/Custom/Antispam/Cleantalk.php(441): json_decode(NULL, true)
#3 /var/www/html/web/modules/contrib/cleantalk/lib/Cleantalk/Custom/Antispam/Cleantalk.php(163): Cleantalk\Custom\Antispam\Cleantalk->httpRequest(Object(Cleantalk\Custom\Antispam\CleantalkRequest))
#4 /var/www/html/web/modules/contrib/cleantalk/src/Form/CleantalkSettingsForm.php(95): Cleantalk\Custom\Antispam\Cleantalk->sendFeedback(Object(Cleantalk\Custom\Antispam\CleantalkRequest))
#5 [internal function]: Drupal\cleantalk\Form\CleantalkSettingsForm->validateForm(Array, Object(Drupal\Core\Form\FormState))
#6 /var/www/html/web/core/lib/Drupal/Core/Form/FormValidator.php(82): call_user_func_array(Array, Array)
#7 /var/www/html/web/core/lib/Drupal/Core/Form/FormValidator.php(275): Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object(Drupal\Core\Form\FormState))
#8 /var/www/html/web/core/lib/Drupal/Core/Form/FormValidator.php(118): Drupal\Core\Form\FormValidator->doValidateForm(Array, Object(Drupal\Core\Form\FormState), 'cleantalk_setti...')
#9 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(593): Drupal\Core\Form\FormValidator->validateForm('cleantalk_setti...', Array, Object(Drupal\Core\Form\FormState))
#10 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(325): Drupal\Core\Form\FormBuilder->processForm('cleantalk_setti...', Array, Object(Drupal\Core\Form\FormState))
#11 /var/www/html/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\cleantalk\Form\CleantalkSettingsForm), Object(Drupal\Core\Form\FormState))
#12 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#13 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#14 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#15 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#16 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#17 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#18 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#19 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /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)
#22 /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)
#23 /var/www/html/web/modules/contrib/cleantalk/src/EventSubscriber/BootSubscriber.php(209): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\cleantalk\EventSubscriber\BootSubscriber->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#29 {main}
๐Ÿ› Bug report
Status

Fixed

Version

9.3

Component

Code

Created by

๐Ÿ‡จ๐Ÿ‡ฆCanada blainelang

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