Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#5 | 2821639-5.patch | 936 bytes | mondrake |
Comments
Comment #2
BerdirComment #4
mondrakeComment #5
mondrakeThanks @Berdir, committed to 8.x-1.x
This is the patch for 8.x-2.x
Comment #7
mondrakeCommitted #5 to 8.x-2.x