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
When debugging is enabled trough the search_api_solr_devel module, every search response body is stored as the logging message. This causes, when accessing the debug information through the dblog interface, running the t() function on that body.
This floods the locale tables with untranslatable content. A fatal error is triggered if the response body is too large to handle by the locales_source table.
Proposed resolution
Use a placeholder as message and pass the response body as the logging message context.
modules/search_api_solr_devel/src/Logging/SolariumRequestLogger.php:85
$this->getLogger()->debug(
'@solr_request_body',
['@solr_request_body' => $response->getBody()]
);
Comment | File | Size | Author |
---|---|---|---|
#2 | log_response_body_as_context-3089339-2.patch | 680 bytes | zero2one |
Comments
Comment #2
zero2one CreditAttribution: zero2one at Serial Graphics for District09 commentedThis patch fixes the issue.
See also PR https://github.com/mkalkbrenner/search_api_solr/pull/50
Comment #3
mkalkbrennerI had a look at the implementation at core. I think it's erroneous as it avoids translation if the the vars are NULL. But our usage seems to lead to an empty array instead of NULL.
Anyway, your patch makes sense as a workaround.
Comment #4
mkalkbrennerComment #6
mkalkbrennerCommitted. Thanks!