This module version is not working with Drupal 11.4.1
It may be related to changes from https://www.drupal.org/project/drupal/issues/3560398

When visiting page only this error is displayed:
TypeError: Drupal\dblog\Controller\DbLogController::__construct(): Argument #2 ($date_formatter) must be of type Drupal\Core\Datetime\DateFormatterInterface, Drupal\Core\Extension\ModuleHandler given, called in /var/www/www.mysite.com/web/modules/contrib/watchdog_search/src/Controller/DbLogC... on line 51 in Drupal\dblog\Controller\DbLogController->__construct() (line 51 of core/modules/dblog/src/Controller/DbLogController.php).

I was able to fix it (with Claude AI)

diff --git a/DbLogController.php b/DbLogController.php
index 347d1f5..8e575b5 100644
--- a/DbLogController.php
+++ b/DbLogController.php
@@ -12,13 +12,13 @@
 use Drupal\Core\Database\Query\TableSortExtender;
 use Drupal\Core\Datetime\DateFormatterInterface;
 use Drupal\Core\Datetime\DrupalDateTime;
-use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\FormBuilderInterface;
 use Drupal\Core\Form\FormInterface;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Logger\RfcLogLevel;
 use Drupal\Core\Url;
 use Drupal\dblog\Controller\DbLogController as DbLogControllerBase;
+use Drupal\dblog\DbLogFilters;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\RequestStack;
@@ -39,18 +39,18 @@ class DbLogController extends DbLogControllerBase implements FormInterface
      *
      * @param \Drupal\Core\Database\Connection               $database
      *   A database connection.
-     * @param \Drupal\Core\Extension\ModuleHandlerInterface  $module_handler
-     *   A module handler.
      * @param \Drupal\Core\Datetime\DateFormatterInterface   $date_formatter
      *   The date formatter service.
      * @param \Drupal\Core\Form\FormBuilderInterface         $form_builder
      *   The form builder service.
+     * @param \Drupal\dblog\DbLogFilters                     $dbLogFilters
+     *   The dblog filters service.
      * @param \Symfony\Component\HttpFoundation\RequestStack $requestStack
      *   The request stack.
      */
-    public function __construct(Connection $database, ModuleHandlerInterface $module_handler, DateFormatterInterface $date_formatter, FormBuilderInterface $form_builder, RequestStack $requestStack)
+    public function __construct(Connection $database, DateFormatterInterface $date_formatter, FormBuilderInterface $form_builder, DbLogFilters $dbLogFilters, RequestStack $requestStack)
     {
-        parent::__construct($database, $module_handler, $date_formatter, $form_builder);
+        parent::__construct($database, $date_formatter, $form_builder, $dbLogFilters);
         $this->currentRequest = $requestStack->getCurrentRequest();
     }

@@ -61,13 +61,14 @@ public static function create(ContainerInterface $container): self
     {
         return new static(
             $container->get('database'),
-            $container->get('module_handler'),
             $container->get('date.formatter'),
             $container->get('form_builder'),
+            $container->get(DbLogFilters::class),
             $container->get('request_stack'),
         );
     }

+
     /**
      * {@inheritdoc}
      */
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

bohus ulrych created an issue. See original summary.

jrb made their first commit to this issue’s fork.

jrb’s picture

Status: Active » Needs review

I've created an MR with these changes.

vtamasc’s picture

StatusFileSize
new2.74 KB

  • jrb committed 13d054e5 on 1.0.x
    Fix constructor and create() method to work after updates to parent #...