Commit 05705fc9 authored by alexpott's avatar alexpott

Issue #2504849 by Berdir, catch, alexpott: User::getAnonymousUser() takes 13ms...

Issue #2504849 by Berdir, catch, alexpott: User::getAnonymousUser() takes 13ms due to ContentEntityBase::setDefaultLangcode()
parent 652ab4a0
......@@ -416,6 +416,9 @@ public static function getAnonymousUser() {
static::$anonymousUser = new $class([
'uid' => [LanguageInterface::LANGCODE_DEFAULT => 0],
'name' => [LanguageInterface::LANGCODE_DEFAULT => ''],
// Explicitly set the langcode to ensure that field definitions do not
// need to be fetched to figure out a default.
'langcode' => [LanguageInterface::LANGCODE_DEFAULT => LanguageInterface::LANGCODE_NOT_SPECIFIED]
], $entity_type->id());
}
return clone static::$anonymousUser;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment