Fix warning: Array to string conversion

Created on 27 May 2022, about 3 years ago
Updated 19 May 2023, about 2 years ago

Problem/Motivation

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

Warning: Array to string conversion in Drupal\purge_purger_http\Plugin\Purge\Purger\HttpPurger->invalidate() (line 51 of modules/contrib/purge_purger_http/src/Plugin/Purge/Purger/HttpPurger.php).
Drupal\purge_purger_http\Plugin\Purge\Purger\HttpPurger->invalidate(Array) (Line: 483)
Drupal\purge\Plugin\Purge\Purger\PurgersService->invalidate(Object, Array) (Line: 84)
Drupal\purge_processor_lateruntime\EventSubscriber\LateRuntimeProcessor->onKernelFinishRequest(Object, 'kernel.finish_request', Object)
call_user_func(Array, Object, 'kernel.finish_request', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.finish_request') (Line: 207)
Symfony\Component\HttpKernel\HttpKernel->finishRequest(Object, 1) (Line: 193)
Symfony\Component\HttpKernel\HttpKernel->filterResponse(Object, Object, 1) (Line: 179)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

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.

Proposed resolution

Patch to solve the php warning.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇯🇴Jordan Odai Atieh Amman

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.71.5 2024