Compatiblity issue with the FileLogger interface

Created on 9 January 2024, 12 months ago

Problem/Motivation

During the installation of the module, I get the following error.

Fatal error: Declaration of Drupal\fileslog\Logger\FilesLog::log($level, Stringable|string $message, array $context = []): void must be compatible with Drupal\Core\Logger\RfcLoggerTrait::log($level, $message, array $context = []) in /modules/contrib/fileslog/src/Logger/FilesLog.php
🐛 Bug report
Status

Closed: duplicate

Version

1.1

Component

Code

Created by

🇵🇰Pakistan hmdnawaz

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

Comments & Activities

  • Issue created by @hmdnawaz
  • Status changed to Postponed: needs info 12 months ago
  • 🇧🇪Belgium RandalV

    Hi @hmdnawaz,

    Could you tell me what Drupal and PHP version you're working on?
    Sadly some compatibility issues arose with later versions of fileslog in combination with earlier PHP versions.

    See the module page warning:

    WARNING: Version 1.0.3 is the last one that is compatible with Drupal 9! Version 1.1.x should be used for PHP 8.1 + Drupal 10.
    Apologies for the mishaps in versioning, 1.0.4 shouldn't have existed in that range and 1.1.x should not be compatible with 9.5.x according to composer.

  • Status changed to Active 12 months ago
  • 🇵🇰Pakistan hmdnawaz

    I'm using Drupal version 9.5.11 and PHP version 8.1

  • Status changed to Closed: duplicate 12 months ago
  • 🇧🇪Belgium RandalV

    Hi @hmdnawaz,

    See the warning on the main module page, due to some mishaps in compatibilities, version 1.1.x of the module is still installed on 9.5.x installation but this should not be the case.

    If you're working on 9.5.x, you'll have to use version 1.0.3 of this module.
    composer require 'drupal/fileslog:1.0.3'

    See also:
    💬 Declaration of FilesLog::log(...) must be compatible with Drupal\Core\Logger\RfcLoggerTrait::log(...) Fixed

    The title of that issue wasn't representative of the actual issue, I've changed it now to the above.

  • 🇵🇰Pakistan hmdnawaz

    Hi RandalV,

    But on the module page, with version 1.1.1, it is mentioned that it is compatible with ^9.4 || ^10.

    If it is not working on Drupal 9, then it should be mentioned on the module page that it will only works ^10

Production build 0.71.5 2024