I just discovered that if you pass NULL as the value to a placeholder in a log entry, this will blow up when using dblog and visiting the “Recent log messages” page with the following error:
TypeError: Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given, called in core/lib/Drupal/Component/Render/FormattableMarkup.php on line 238 in Drupal\Component\Utility\Html::escape() (line 431 of core/lib/Drupal/Component/Utility/Html.php).
Apparently those are handled fine by t(), but not by the dblog module.

Issue fork search_api-3483581

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

drunken monkey created an issue. See original summary.

drunken monkey’s picture

Status: Active » Needs review

Fixed in this MR, please test/review.

While most of the places in the code concerned entity labels (search indexes in most cases, to be precise) which can be NULL theoretically, the most important changes were probably the ones concerning fields, in the AddHierarchy and RenderedItem processors, as field labels are probably more often NULL than entity labels.

  • drunken monkey committed 9f17b54a on 8.x-1.x
    Issue #3483581 by drunken monkey: Fixed NULL placeholders in log entries...
drunken monkey’s picture

Issue summary: View changes
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.