Problem/Motivation

We got errors like this one on a D8 site:

InvalidArgumentException: $string ("@suite error @code: @error") must be a string. in Drupal\Core\StringTranslation\TranslatableMarkup->__construct() (Zeile 140 in .../core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php).

The problem is that watchdog translated messages itself and this results in double translation which in turn results in this error.

Proposed resolution

Remove the t(), pass the arguments as logger context. I also added the command line that was executed to make it easier to debug and reproduce the problem.

Remaining tasks

Check for similar problems, fix them too.

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#5 2821639-5.patch936 bytesmondrake
#2 imagemagick-t-error-2821639.patch889 bytesBerdir
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir created an issue. See original summary.

Berdir’s picture

Status: Active » Needs review
FileSize
889 bytes

  • mondrake committed f7bbe40 on 8.x-1.x authored by Berdir
    Issue #2821639 by Berdir: TranslateMarkup object (t()) passed to logger
    
mondrake’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
mondrake’s picture

FileSize
936 bytes

Thanks @Berdir, committed to 8.x-1.x

This is the patch for 8.x-2.x

  • mondrake committed 8e0214f on 8.x-2.x authored by Berdir
    Issue #2821639 by Berdir, mondrake: TranslateMarkup object (t()) passed...
mondrake’s picture

Status: Needs review » Fixed

Committed #5 to 8.x-2.x

Status: Fixed » Closed (fixed)

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