Argument 1 passed to Drupal\Core\Language\Language::Drupal\Core\Language\{closure}() must implement interface Drupal\Core\Language\LanguageInterface, null given

Created on 22 April 2020, over 5 years ago
Updated 3 July 2025, 3 months ago

Using latest version of domain (1.x-dev) and the latest dev version of this module (1.x-dev):
when I first tried to edit a domains languages I got the error as described here:
https://www.drupal.org/project/domain_language/issues/3129889
after that error is fixed (see patch in that issue) I now see another error when I try to edit a domains languages:

Argument 1 passed to Drupal\Core\Language\Language::Drupal\Core\Language\{closure}() must implement interface Drupal\Core\Language\LanguageInterface, null given

I notice that in order to be able to continue my work I could make a change in web/modules/contrib/domain_language/src/Form/DomainLanguageForm.php
transforming this line:

$languages = \Drupal::languageManager()->getNativeLanguages();

into this:

$languages = \Drupal::languageManager()->getLanguages();

because it seems that getNativeLanguages returns null.

🐛 Bug report
Status

Postponed: needs info

Version

2.0

Component

Code

Created by

🇧🇪Belgium flyke

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇧🇪Belgium JeroenT 🇧🇪

    Does this issue still exist in the 2.0.x branch?

  • 🇧🇪Belgium flyke

    Sadly I cannot test or confirm that the issue still exists in the 2.0x branch. I see that we don't have a project anymore that uses the domain_language module. Maybe our requirements changed because of changes to the domain module itself, or maybe because of the fact that we are using the domain_language_negotiation module.
    But as far as I'm concerned, this ticket may be closed. It's an ancient one by now and noone else seems to have this issue.

Production build 0.71.5 2024