πŸ‡ΈπŸ‡ͺSweden @hansson192

Account created on 10 June 2021, over 3 years ago
#

Recent comments

πŸ‡ΈπŸ‡ͺSweden hansson192

I got this exact error whilst trying to update Drupal to 9.5.9 and running phpUnit on our custom modules in a custom profile. Your patch did indeed solve our issues but whilst looking into the error I noticed that the user entity's getDisplayName defaults to user.settings value for anonymous, and said file was missing for us because of some changes that had been made to our testing process.

  public function getDisplayName() {
    $name = $this->getAccountName() ?: \Drupal::config('user.settings')->get('anonymous');
    \Drupal::moduleHandler()->alter('user_format_name', $name, $this);
    return $name;
  }

So by making sure that user.settings.yml with the key anonymous and a value existed and were accessible the errors disappeared.

Production build 0.71.5 2024