Reports can not be generated when site uses a module that overwrites the default logger factory

Created on 31 October 2022, about 2 years ago
Updated 27 February 2023, over 1 year ago

Problem/Motivation

Reports can not be generated when site uses a module that overwrites the default logger factory.

Steps to reproduce

Navigate to Site Audit report, and the following error is rendered:

The website encountered an unexpected error. Please try again later.
TypeError: Argument 5 passed to Drupal\site_audit\Plugin\SiteAuditCheckBase::__construct() must be an instance of Drupal\Core\Logger\LoggerChannelFactory, instance of Drupal\redirect_404\Render\Redirect404LogSuppressor given, called in /var/www/cascade/staging/ftcshared/htdocs-2022-10-18_16:06:04-1666109163384/web/modules/contrib/site_audit/src/Plugin/SiteAuditCheckBase.php on line 120 in Drupal\site_audit\Plugin\SiteAuditCheckBase->__construct() (line 91 of modules/contrib/site_audit/src/Plugin/SiteAuditCheckBase.php).
Drupal\site_audit\Plugin\SiteAuditCheckBase->__construct() (Line: 120)
Drupal\site_audit\Plugin\SiteAuditCheckBase::create() (Line: 21)
Drupal\Core\Plugin\Factory\ContainerFactory->createInstance() (Line: 83)
Drupal\Component\Plugin\PluginManagerBase->createInstance() (Line: 121)
Drupal\site_audit\Plugin\SiteAuditReportBase->__construct() (Line: 25)
Drupal\Core\Plugin\Factory\ContainerFactory->createInstance() (Line: 83)
Drupal\Component\Plugin\PluginManagerBase->createInstance() (Line: 76)
Drupal\site_audit\Controller\SiteAuditController->audit()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 159)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 50)
Drupal\ban\BanMiddleware->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23)
Stack\StackedHttpKernel->handle() (Line: 709)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Proposed resolution

Change LoggerChannelFactory reference to LoggerChannelFactoryInterface instead.

Remaining tasks

Create patch

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States dietric@gmail.com

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