Fix Warning: Undefined array key scheme and request method

Created on 9 February 2023, almost 2 years ago
Updated 19 May 2023, over 1 year ago

Problem/Motivation

I faced an issue after I added a purger as the below:

Warning: Undefined array key "BAN" en Drupal\purge_purger_http\Form\HttpPurgerFormBase->submitFormSuccess() (lΓ­nea 559 de /var/www/html/web/modules/contrib/purge_purger_http/src/Form/HttpPurgerFormBase.php)

#0 /var/www/html/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real()
#1 /var/www/html/web/modules/contrib/purge_purger_http/src/Form/HttpPurgerFormBase.php(559): _drupal_error_handler()
#2 /var/www/html/web/modules/contrib/purge/modules/purge_ui/src/Form/PluginConfigFormBase.php(96): Drupal\purge_purger_http\Form\HttpPurgerFormBase->submitFormSuccess()
#3 [internal function]: Drupal\purge_ui\Form\PluginConfigFormBase->submitForm()
#4 /var/www/html/web/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php(69): call_user_func_array()
#5 /var/www/html/web/core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php(109): Drupal\Core\Form\FormAjaxResponseBuilder->buildResponse()
#6 [internal function]: Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber->onException()
#7 /var/www/html/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func()
#8 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(229): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#9 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(92): Symfony\Component\HttpKernel\HttpKernel->handleThrowable()
#10 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#11 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#12 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#13 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#14 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#15 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#16 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#17 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(707): Stack\StackedHttpKernel->handle()
#18 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#19 {main}

.
Warning: Undefined array key "http" en Drupal\purge_purger_http\Form\HttpPurgerFormBase->submitFormSuccess() (lΓ­nea 556 de /var/www/html/web/modules/contrib/purge_purger_http/src/Form/HttpPurgerFormBase.php)

#0 /var/www/html/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real()
#1 /var/www/html/web/modules/contrib/purge_purger_http/src/Form/HttpPurgerFormBase.php(556): _drupal_error_handler()
#2 /var/www/html/web/modules/contrib/purge/modules/purge_ui/src/Form/PluginConfigFormBase.php(96): Drupal\purge_purger_http\Form\HttpPurgerFormBase->submitFormSuccess()
#3 [internal function]: Drupal\purge_ui\Form\PluginConfigFormBase->submitForm()
#4 /var/www/html/web/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php(69): call_user_func_array()
#5 /var/www/html/web/core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php(109): Drupal\Core\Form\FormAjaxResponseBuilder->buildResponse()
#6 [internal function]: Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber->onException()
#7 /var/www/html/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func()
#8 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(229): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#9 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(92): Symfony\Component\HttpKernel\HttpKernel->handleThrowable()
#10 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#11 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#12 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#13 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#14 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#15 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#16 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#17 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(707): Stack\StackedHttpKernel->handle()
#18 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#19 {main}

.

The form_state variable is being modified in the submit.

I am using:

  • Drupal 9.5.0
  • PHP 8.1

Steps to reproduce

1- Go to purge settings page "/admin/config/development/performance/purge".
2- Add a new HTTP purger.
3- After refreshing the page it will show the warning.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain fbocanegra

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

Comments & Activities

Production build 0.71.5 2024