D9-D10 upgrade causes fatal error in RulesLog.php

Created on 15 May 2024, 8 months ago
Updated 30 May 2024, 7 months ago

Problem/Motivation

Steps to reproduce

Upgraded from Drupal 9.5.2 to D10.2.6. Throws "Fatal error: Declaration of Drupal\rules\Logger\RulesLog::log($level, $message, array $context = []) must be compatible with Drupal\Core\Logger\RfcLoggerTrait::log($level, Stringable|string $message, array $context = []): void in /home/djqias303hch/public_html/modules/rules/src/Logger/RulesLog.php on line 52".

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Summary: To avoid confusion with https://www.drupal.org/project/rules/issues/3400677#comment-15594492 πŸ’¬ D9-D10 upgrade causes fatal error in RulesLog.php Closed: works as designed , I'll creating this new issue as a bug report.

To the maintainer:

According to https://www.drupal.org/node/3284415 β†’ , I have tried to follow the recommendations, thus tried both suggestions. Both create an additional error.

So, as an example, replacing line 52 in /modules/rules/src/Logger/RulesLog.php with
public function log($level, string|\Stringable $message, array $context = []): void {
or
public function log($level, $message, array $context = []): void {

produces the following error:
TypeError: Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher::dispatch(): Argument #1 ($event) must be of type object, string given, called in /var/www/html/web/modules/contrib/rules/src/Logger/RulesLog.php on line 75 in Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (line 89 of /var/www/html/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php).

πŸ› Bug report
Status

Closed: duplicate

Component

Rules Core

Created by

πŸ‡©πŸ‡°Denmark s@ilor

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

Comments & Activities

Production build 0.71.5 2024