varnish_image_purge sub-module D11 Compatibility error

Created on 14 April 2025, 10 days ago

Problem/Motivation

If the sub-module varnish_image_purge is enabled on a fresh Drupal 11 installation, the following error is thrown:
ArgumentCountError: Too few arguments to function Drupal\Core\Form\ConfigFormBase::__construct(), 1 passed in /app/web/modules/contrib/varnish_purge/modules/varnish_image_purge/src/Form/VarnishImagePurgeConfiguration.php on line 47 and exactly 2 expected in Drupal\Core\Form\ConfigFormBase->__construct() (line 43 of core/lib/Drupal/Core/Form/ConfigFormBase.php).

rupal\varnish_image_purge\Form\VarnishImagePurgeConfiguration->__construct(Object, Object, Object) (Line: 56)
Drupal\varnish_image_purge\Form\VarnishImagePurgeConfiguration::create(Object) (Line: 36)
Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition('\Drupal\varnish_image_purge\Form\VarnishImagePurgeConfiguration') (Line: 48)
Drupal\Core\Controller\HtmlFormController->getFormObject(Object, '\Drupal\varnish_image_purge\Form\VarnishImagePurgeConfiguration') (Line: 58)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 593)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->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: 263)
Drupal\shield\ShieldMiddleware->bypass(Object, 1, 1) (Line: 171)
Drupal\shield\ShieldMiddleware->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: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 709)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

  1. Enable the sub-module varnish_image_purge.
  2. Visit the varnish_image_purge configuration page at: /admin/config/development/varnish_image_purge.

Proposed resolution

As per this documentation New parameter added to \Drupal\Core\Form\ConfigFormBase::__construct , the ConfigFormBase constructor now accepts a \Drupal\Core\Config\TypedConfigManagerInterface argument which is optional since ^10.2 and is required since 11.0. So, there should be a new release since ^10.2 Drupal core version and fix the /varnish_purge/modules/varnish_image_purge/src/Form/VarnishImagePurgeConfiguration.php file.

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

Active

Version

2.3

Component

Code

Created by

🇨🇴Colombia carma03

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