TypeError: Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given

Created on 8 May 2025, 2 days ago

TypeError: Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given, called in web\core\lib\Drupal\Component\Render\FormattableMarkup.php on line 238 in Drupal\Component\Utility\Html::escape() (line 431 of web\core\lib\Drupal\Component\Utility\Html.php).

upgrade to drupal 11 create logger and pass null value like this or whenever you use variable driven from field and this filed is empty
\Drupal::logger("test")->info("pass null @var",["@var"=>null])

go to /admin/reports/dblog the error above will appear

๐Ÿ› Bug report
Status

Needs review

Version

11.0 ๐Ÿ”ฅ

Component

render system

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024