Error when using markdown module with PHP 8.1 on Drupal 9.3

Created on 19 February 2022, over 2 years ago
Updated 21 February 2024, 9 months ago

Problem/Motivation

I recently updated PHP to 8.1, as it's recommended by Drupal for 9.x.
Since then, I get this error on every page of my Drupal site: Deprecated function: Return type of Drupal\markdown\Annotation\Identifier::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in include() (line 20 of modules/contrib/markdown/src/Annotation/Identifier.php).
Full error message: https://paste.ee/p/yDfIp

Steps to reproduce

Update PHP to v8.1 on a Drupal 9.3 site. I am using league/commonmark (v1.6.7, can't go to ^2 because of this issue ) as a Markdown parser. I also tried erusev/parsedown (v1.7.4), but it shows the exact same error.

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇩🇪Germany comniemeer

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024