Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291715

Logger tries to replace {users_field_data} with current user object

$
0
0

Problem/Motivation

If you have e.g. an exception when writing to a user table, then \Drupal\Core\Logger\LogMessageParser::parseMessagePlaceholders() converts {users_field_data} to @users_field_data and then, because we have a context key 'user', it tries to put the AccountProxy object in there, which gives you this recoverable fatal error:

Object of class Drupal\Core\Session\AccountProxy could not be converted to string

Proposed resolution

Only replace {something} with @something if we actually have something in $context?

Possibly also explicitly exclude keys that we do not want to get replaces, so even if you have {user}, that it will not try to replace it.

Remaining tasks

User interface changes

API changes

Data model changes


Viewing all articles
Browse latest Browse all 291715

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>