Skip to content

Avoid Translating Logged Messages in Cloudflare Module to Prevent Fatal Error

Problem

Using $this->t() for log messages in the Cloudflare module can cause a fatal error:

Fatal error: Call to a member function getRequestUri() on null in core/modules/locale/src/LocaleLookup.php

Solution

Replace $this->t() calls with plain text strings and use sprintf for message formatting.

Changes

  • Removed $this->t() from log messages.
  • Implemented sprintf for argument formatting.

Closes #3464467

Merge request reports

Loading