Do not localize errorlog messages

Created on 29 October 2014, about 10 years ago
Updated 14 December 2024, 7 days ago

Localizing the error message in theme_errorlog_format (errorlog.module) is dangerous.
Every "page not found" found message added an entry in locales_source.
The locales_source ended with 100'000s of entries => Locales caching didn't work properly anymore => The website wasn't usable anymore.

In a multilanguage environment it is better to have only one language in the logfile (en).
Translationg the log messages creates entries in different languages in the logfile.

To fix this issue, just replace the line...

  $message .= '|message=' . strip_tags(t($log_msg['message'], $log_msg['variables']));

... with the following line ...

  $message .= '|message=' . strip_tags(format_string($log_msg['message'], $log_msg['variables']));
πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡­Switzerland valentin schmid

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΈπŸ‡°Slovakia poker10

    Thanks for reporting this. If someone can create an MR with the fix, I can merge it to the D7 version of the module (until D7 EOL). However I have also seen that translations are used in the maillog submodule as well, so I think we need to check all places, where this needs to be fixed. Thanks.

    FWIW, this does not seems to be an issue in the D8+ version of the module.

Production build 0.71.5 2024