This is what I provided now as a sort of "minimal" regression test. Then also making NodeTypeTranslationTest install Drupal in a different language then makes the exception described in the issue summary appear. Removing that line makes that notice appear in the test. This was hard to catch in #2571337: Node type title label cannot be translated in the UI because the test code was being moved. Interestingly the "non-existing config name" leads to a problem (an undefined index notice, to be precise) in ConfigTranslationFormBase as well but that is explicitly worked around in NodeTypeTranslationTest by adding the core.base_field_override.node.$node_type.title specifically. And weirdly $config_factory->get($name)->get('langcode') simply returns NULL without throwing an error which is why we then reach the fallback. In looking at that in more detail I found that the problem is that since #2571337: Node type title label cannot be translated in the UI NodeTypeMapper adds core.base_field_override.node.$node_type.title to the list of config names even if that config object does not exist. It's there as a safeguard for contrib and custom modules, that forget to set a language code. all configuration should always have a language code explicitly, thus the fallback (whether it be to en or to the site's default language) should be theoretical only at least in core. In studying the code more in-depth, however, I wondered why we even reach that fallback anyway. Support from Acquia helps fund testing for Drupal Comments
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |