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()]
    );
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zero2one created an issue. See original summary.

zero2one’s picture

Status: Needs work » Needs review
FileSize
680 bytes

This patch fixes the issue.

See also PR https://github.com/mkalkbrenner/search_api_solr/pull/50

mkalkbrenner’s picture

I 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.

mkalkbrenner’s picture

Status: Needs review » Reviewed & tested by the community

mkalkbrenner’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

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