If you only have 1 language enabled together with the translation modules and then you activate the URL interface text language detection (Detection and selection), you get the following error:

TypeError: Argument 1 passed to Drupal\language\LanguageNegotiationMethodBase::setCurrentUser() must implement interface Drupal\Core\Session\AccountInterface

This seems to be because the LanguageSwitchLinks are disabled in this case, only on some admin pages.

I suggest to disable the alternate hreflang feature on admin pages to avoid this issue. Admin pages do not need to have a hreflang anyhow.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hoebekewim created an issue. See original summary.

hoebekewim’s picture

Suggested patch

  • mfb committed 6bf009c on 8.x-1.x
    Issue #2821038 reported by hoebekewim: TypeError when a single language...
mfb’s picture

Status: Active » Fixed

Thanks for reporting

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.