- Issue created by @joachim
The return of LanguageManagerInterface::getLanguageSwitchLinks() is this:
* @return object|null
* An object with the following keys:
* - links: An array of links indexed by the language ID
* - method_id: The language negotiation method ID
* or NULL if there are no language switch links.
This seems really bizarre. You can't iterate over it. You have to check if it's NULL or not before you try to access it, because it might not actually be an object.
I can only find one instance in core of the method_id, in LanguageBlock:
"language-switcher-{$links->method_id}",
It also differs from the same named method on LanguageSwitcherInterface, which is confusing.
Change the method to return an array. Add a separate method to get the method_id.
Active
11.0 🔥