- πΊπΈUnited States ccarnnia
I came across this issue today on a D10 site.
Not totally sure but i think this site had problems during an updb when core was upgraded last.
i went to another healthy site and ran config export:
drush @MYGOODSITE cex
copied the following .yml files from MYGOODSITE's config/sync to a /tmp/bla folder:
language.content_settings.path_alias.path_alias.yml
language.content_settings.redirect.redirect.yml
language.entity.en.yml
language.entity.und.yml
language.entity.zxx.yml
language.mappings.yml
language.negotiation.yml
language.types.ymledit each of these files and deleted the UUID.
and then imported them to MYBADSITE :
drush @MYBADSITE config:import --partial --source=/tmp/bla/
I had to run the config:import 2 times .
1st tim it only imported negotiation.
This fixed the issue for me. - πΊπΈUnited States TolstoyDotCom L.A.
I ran into this with a copy of D11 dev that I downloaded a few weeks ago. I installed the ai module and several of its submodules at the same time, including experimental modules. I assume the issue was because of ai_translate. I only had the default language installed. The error I got was:
Uncaught PHP Exception TypeError: "Drupal\\language\\LanguageNegotiator::updateConfiguration(): Argument #1 ($types) must be of type array, null given, called in /web/core/modules/language/language.module on line 321" at /web/core/modules/language/src/LanguageNegotiator.php line 306, referer: admin/modules/list/confirm-non-stable
When I went to admin/config/regional/language/detection as #34 suggests, I got another error:
Uncaught PHP Exception TypeError: "in_array(): Argument #2 ($haystack) must be of type array, null given" at /web/core/modules/language/src/Form/NegotiationConfigureForm.php line 141
The problem is calls to
$configurable = $this->languageTypes->get('configurable')
and$configurable = $this->config->get('configurable')
can return NULL. When$configurable
is used inin_array
etc it results in those errors.Unless that return value shouldn't ever be null and there's a more fundamental problem, it seems like the solution is to follow those calls with
$configurable = $configurable ?? [];
or similar.