Problem/Motivation
Having the following
PHP Fatal error: Type of Drupal\checklistapi\Commands\ChecklistapiCommands::$logger must be ?Psr\Log\LoggerInterface (as in class Drush\Commands\DrushCommands) in /var/www/html/test/drupal10test/docroot/modules/contrib/checklistapi/src/Commands/ChecklistapiCommands.php on line 18
Change records
Update code that implements \Psr\Log\LoggerInterface due to Psr/Log version 3
#3272447: Update to PSR/log v3
#3264918: Update symfony/console to Symfony 6
Proposed resolution
Have a Drupal 9 and Drupal 10 compatible logger
As in Drupal Change records
All the methods that are on\Psr\Log\LoggerInterfacehave stricter typehints. Contrib and custom modules that provide logger implementations will need to be updated for Drupal 10.Typically code that uses the
\Drupal\Core\Logger\RfcLoggerTraitwill only need to change:
public function log($level, $message, array $context = []) {
to
public function log($level, string|\Stringable $message, array $context = []): void {
Remaining tasks
- N/A
User interface changes
- N/A
API changes
- N/A
Data model changes
- N/A
Issue fork checklistapi-3345172
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
Comment #2
rajab natshahComment #3
rajab natshahThis issue was fixed and committed in #3310067: Use \Drush\Commands\DrushCommands::logger() in ChecklistapiCommands
But not released yet.
Having a Real physical testing round for Checklist API 2.1.1 with Drupal ~10
Using the following commit patch as a TEMP fix for the 2.1.1 release
https://git.drupalcode.org/project/checklistapi/-/commit/4b02386.patch
Hoping for a release tag
Comment #5
chandu7929 commentedJust check this is included in 2.1.2