Problem/Motivation
Consider the config attached in the IS and especially the key "language.types.negotiation.language_content.enabled".
If the config to be imported contains enabled negotiation methods for language_content then the LanguageNegotiator from the language module will remove them if language_content is "locked". language_content becomes unlocked when the module content_translation is installed (hook: content_translation_language_types_info_alter).
If you add in the stadard profile "language and content_translation modules" the content_translation module will be installed before the language module and such a config is imported properly because the language type language_content is already unlocked.
But if you install a custom profile with a module named for example "a_custom" with the language module as a dependency, then the language module will be installed before the content_translation module which means when the config is imported the language_content language type will be still "locked" and the config will not be properly imported.
Proposed resolution
The language types info is now provided hard coded by the core LanguageManager::getDefinedLanguageTypesInfo and is overwritten in the language module by ConfigurableLanguageManager::getDefinedLanguageTypesInfo, which then fires the hook "language_types_info" to allow other modules to alter the language types info, like content_translation does and unlocks the language type language_content.
A possible solution would be to provide the language types info not anymore hard coded but through a config so that is could be installed with a language type info marked as "unlocked". The hook "language_types_info" could then be probably marked as deprecated....
Remaining tasks
Discuss what kind of a solution is acceptable.
User interface changes
none
API changes
Depends on the solution. To be discussed.
Data model changes
none
Comment | File | Size | Author |
---|---|---|---|
language.types_.yml.txt | 818 bytes | hchonov |
Comments
Comment #2
hchonovComment #3
hchonovComment #4
andypostRelated #2599228-4: Programmatically created translatable content type returns SQL error on content creation
Comment #5
alexpottNot sure how that happens - it depends on the language module.
Comment #6
hchonovI am not really sure as well how this happens, but that is what I am observing with the install profile we've defined.
Assigning to me so that I create a test with a test install profile and a module to show the problem.
Comment #8
andypostComment #9
hchonovComment #22
smustgrave CreditAttribution: smustgrave at Mobomo commentedThis issue is being reviewed by the kind folks in Slack, #need-reveiw-queue. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge require as a guide.
Didn't see a patch to review but sounds like this needs more discussion.
If no longer a valid issue please close.