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

Created on 21 November 2022, over 1 year ago
Updated 26 February 2024, 4 months ago

Problem/Motivation

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
Status

Fixed

Version

10.2 โœจ

Component
Commentย  โ†’

Last updated 3 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 Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024