Comment form gives deprecated warnings on PHP 8.1 when comment is empty

Created on 21 November 2022, over 1 year ago
Updated 12 February 2024, 13 days ago


The comments module displays deprecated warnings when empty comments are "submitted" on an environment with PHP 8.1.

Steps to reproduce

With an environment running PHP 8.1, enable comments and errors display. Attempt to add an empty comment on a node. This deprecation warning will be shown:

Deprecated function: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\comment\CommentForm->buildEntity() (line 323 of core/modules/comment/src/CommentForm.php).

Proposed resolution

Strip_tags parรกmeter (the comment body) should be cast to string.

๐Ÿ› Bug report



10.2 โœจ

Commentย  โ†’

Last updated 7 days ago

Created by

๐Ÿ‡ช๐Ÿ‡ธSpain Juanjol Navarra

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

Merge Requests

Comments & Activities

Not all content is available!

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

Production build 0.61.6-2-g546bc20