diff --git a/core/modules/user/src/Entity/User.php b/core/modules/user/src/Entity/User.php index 62dce88..0a6f97b 100644 --- a/core/modules/user/src/Entity/User.php +++ b/core/modules/user/src/Entity/User.php @@ -259,10 +259,8 @@ public function getLastAccessedTime() { // Optimize for the case where the field object has not been initialized // yet, directly access the value. // @todo Use getFieldValue(), see https://www.drupal.org/node/2580551. - if (!isset($this->fields['access'])) { - if (isset($this->values['access'][LanguageInterface::LANGCODE_DEFAULT][0]['value'])) { - return $this->values['access'][LanguageInterface::LANGCODE_DEFAULT][0]['value']; - } + if (!isset($this->fields['access']) && isset($this->values['access'][LanguageInterface::LANGCODE_DEFAULT][0]['value'])) { + return $this->values['access'][LanguageInterface::LANGCODE_DEFAULT][0]['value']; } else { return $this->get('access')->value; @@ -329,10 +327,8 @@ public function getTimeZone() { // Optimize for the case where the field object has not been initialized // yet, directly access the value. // @todo Use getFieldValue(), see https://www.drupal.org/node/2580551. - if (!isset($this->fields['timezone'])) { - if (isset($this->values['timezone'][LanguageInterface::LANGCODE_DEFAULT][0]['value'])) { - return $this->values['timezone'][LanguageInterface::LANGCODE_DEFAULT][0]['value']; - } + if (!isset($this->fields['timezone']) && isset($this->values['timezone'][LanguageInterface::LANGCODE_DEFAULT][0]['value'])) { + return $this->values['timezone'][LanguageInterface::LANGCODE_DEFAULT][0]['value']; } else { return $this->get('timezone')->value; @@ -401,10 +397,8 @@ public function getAccountName() { // Optimize for the case where the field object has not been initialized // yet, directly access the value. // @todo Use getFieldValue(), see https://www.drupal.org/node/2580551. - if (!isset($this->fields['name'])) { - if (isset($this->values['name'][LanguageInterface::LANGCODE_DEFAULT][0]['value'])) { - return $this->values['name'][LanguageInterface::LANGCODE_DEFAULT][0]['value']; - } + if (!isset($this->fields['name']) && isset($this->values['name'][LanguageInterface::LANGCODE_DEFAULT][0]['value'])) { + return $this->values['name'][LanguageInterface::LANGCODE_DEFAULT][0]['value']; } else { return $this->get('name')->value;