When setting language detection method, the checkbox Customize Content language detection to differ from User interface text language detection settings is not applied, only the interface configuration.
This leads to two critical issues with translating content:
- It is not possible to edit translated version of a node. All "Edit" urls on node's "Translate" tab are the same and lead to main editing form. See edit.png.
- Translated content is never shown to the user. Default language is always displayed.
Steps to reproduce
On a fresh D8 install:
- Enable content translation and language modules
- Add another language
- Set Detection and selection method to session and browser (tested both, both are broken)
- Configure content type "Article" to be translatable (Administration >> Configuration >> Regional and language)
- Add a node and set it's language to default one (I used article with image. All fields were filled including image)
- Translate node to a second language and save.
- Go to "Translate" tab and investigate "Edit" links. Both lead to the same page.
- Go to the newly create node and try switching language using "session" parameter. You will still see the node in default language.
- Do the same with a browser running second language (or just spoof the browser string to change language). You will still see the node in default language.
Investigate why the checkbox Customize Content language detection to differ from User interface text language detection settings is ignored. The source of the issue lies probably inside Drupal\language\Form\NegotiationConfigureForm::submitForm() function.- the configuration is correctly saved Create patch- Patch is provided
User interface changes
No changes to the UI are required for the fix.
The protected variable type which indicates whether a given type of language usage (language_content, language_interface, language_url) changes to an array to allow different types to initialize during the initialization of another.