When I use honeypot in conjunction with logging_alerts, I get the following exceptions in my logs:
InvalidArgumentException: $string ("Blocked submission of %form due to @cause.") must be a string. in Drupal\Core\StringTranslation\TranslatableMarkup->__construct() (line 133 of core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php).
I think the problem is that honeypot is invoking \Drupal::logger()->notice() with an already-translated message, whereas the \Psr\Log\LoggerInterface methods expect untranslated messages.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | log-messages-double-escaped-3010364-3.patch | 587 bytes | smokris |
Comments
Comment #2
smokrisPatch attached.
Comment #4
smokrisComment #5
smokrisComment #6
tr commentedYes, this is a bug. The Logger should not be using
t()in this manner. The patch is the correct way to fix this.To be clear, this has nothing to do with the logging_alerts module - Honeypot is calling
Logger::notice()with the wrong parameters.Patch applies both to the 2.0.x branch and to the 8.x-1.x branch. As per usual Drupal practice, this should be addressed in the current 2.0.x branch first then should be backported to 8.x-1.x.
Comment #9
tr commentedCommitted and cherry-picked back to 8.x-1.x.