Rollbar is not compatible with Drupal 10 again

Created on 7 August 2023, over 1 year ago
Updated 10 August 2023, over 1 year ago

Problem/Motivation

Drupal 10 uses PSR v3 with has this signature:

public function log($level, string|\Stringable $message, array $context = []): void;

But Drupal 9 uses this signature:

public function log($level, $message, array $context = array());

This leads to an error of type when you try to use Rollbar 3.0.2 in Drupal 9:

Fatal error: Declaration of Drupal\rollbar\Logger\RollbarLogger::log($level, Stringable|string $message, array $context = []): void must be compatible with Drupal\Core\Logger\RfcLoggerTr
ait::log($level, $message, array $context = []) in /var/www/html/web/modules/contrib/rollbar/src/Logger/RollbarLogger.php on line 75

Proposed resolution

I don't see a way to make this two signatures compatible. It seems to be the only problem detected by the upgrade_status module so probably the solution is to provide a patch for those who are upgrading and advice to remove the patch after the upgrade... Or to create a specific release only for D9 with all the compatibility issues fixed.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇦🇷Argentina dagmar Argentina

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

Comments & Activities

Production build 0.71.5 2024