Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291555

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

$
0
0

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.


Viewing all articles
Browse latest Browse all 291555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>