Problem/Motivation

I'm using a drupal 10.1.1 site that migrated from drupal 7, then 9

Submitting the "Content language and translation" form (ContentLanguageSettingsForm) does not save the "Custom language settings" checkboxes.

Steps to reproduce

In "Custom language settings" section, I have 3 values already checked: Content, Redirect, Url Alias.
If I uncheck them, they remain checked after the submit.
If I check a value that's not selected, it won't be saved after submission.

I wanted to activate translations for the menu. Checking the "Custom menu link" value doesn't change anything.

Proposed resolution

This is not a solution, but to correct my problem I modified the ContentLanguageSettingsForm. I had to set the value "language_alterable" to true for "menu_link_content" settings

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

olorin.fr created an issue. See original summary.

bmahesh03121’s picture

Assigned: Unassigned » bmahesh03121
Status: Active » Closed (works as designed)
Issue tags: +dcp23

Works as expected, after selecting an entity type you edit or add default translation and one field. otherwise, it will behave as default settings and will save the configuration.

olorin.fr’s picture

Where did you read that I was talking about entities types?
I never said anything about content types and fields (they work and the "Content" checkbox was already enabled in my case). I'm talking about the part above "Custom language settings". For example to activate translations on others components (menu, ...).

bmahesh03121’s picture

Assigned: bmahesh03121 » Unassigned
Status: Closed (works as designed) » Needs review

apologies, let me clarify, after selecting or deselecting the elements at the top in 'Custom language settings', it will show or hide the details field translations settings. if you want to disable translations you can deselect the fields translations in below details section for particular element and can also set the default value for 'Default language' as the site's default language. after saving that it will not show the element as selected at the top 'Custom language settings'. i understand your issue now. that by changing the settings at the top, it should disable the whole translation. but I think the best way should be to review the fields and enable/disable the translations as required. instead of disabling the translations absolutely with non-recoverable translation loss issues. keeping this in review. please share your thoughts.

smustgrave’s picture

Status: Needs review » Postponed (maintainer needs more info)

@olorin.fr does #4 answer your question?

dww’s picture

Title: "Content language and translation" form doesn't save "Custom language settings" datas » "Content language and translation" form doesn't save "Custom language settings" data
Issue tags: +Bug Smash Initiative

Pedantic nerd warning: “data” is already plural. 😂

avasquez15’s picture

I got the same issue, but it was solve after checking the "Show language selector on create and edit pages" box, or selecting a default language, if you don't do any of those it will not save the config. I hope this help

trickfun’s picture

FileSize
182.26 KB

I got same issue with drupal 10.2
When i open "Content language and translation" page my taxonomy term "Collection type" is checked but i can't see the list of fields.
So i uncheck and check again the "collection type" checkbox but previous selections are lost.

"FAQ tags" checkbox isn't selected but i can see the fields.
Something wrong here.
Thank you

trickfun’s picture

II get this error. Drupal 10.2.2

drupal.js?v=10.2.2:64 Uncaught TypeError: Cannot read properties of undefined (reading 'matches')
    at content_translation.admin.js?v=10.2.2:64:25
    at Array.forEach (<anonymous>)
    at Object.check (content_translation.admin.js?v=10.2.2:57:43)
    at content_translation.admin.js?v=10.2.2:40:63
    at Array.forEach (<anonymous>)
    at Object.attach (content_translation.admin.js?v=10.2.2:35:50)
    at drupal.js?v=10.2.2:166:24
    at Array.forEach (<anonymous>)
    at Drupal.attachBehaviors (drupal.js?v=10.2.2:162:34)
    at HTMLUListElement.<anonymous> (ajax.js?v=10.2.2:1387:20)
(anonymous) @ content_translation.admin.js?v=10.2.2:64
check @ content_translation.admin.js?v=10.2.2:57
(anonymous) @ content_translation.admin.js?v=10.2.2:40
attach @ content_translation.admin.js?v=10.2.2:35
(anonymous) @ drupal.js?v=10.2.2:166
Drupal.attachBehaviors @ drupal.js?v=10.2.2:162
(anonymous) @ ajax.js?v=10.2.2:1387
each @ jquery.min.js?v=3.7.1:2
each @ jquery.min.js?v=3.7.1:2
insert @ ajax.js?v=10.2.2:1385
(anonymous) @ ajax.js?v=10.2.2:1046
setTimeout (async)
Drupal.throwError @ drupal.js?v=10.2.2:63
(anonymous) @ drupal.js?v=10.2.2:168
Drupal.attachBehaviors @ drupal.js?v=10.2.2:162
(anonymous) @ ajax.js?v=10.2.2:1387
each @ jquery.min.js?v=3.7.1:2
each @ jquery.min.js?v=3.7.1:2
insert @ ajax.js?v=10.2.2:1385
(anonymous) @ ajax.js?v=10.2.2:1046
Promise.then (async)
(anonymous) @ ajax.js?v=10.2.2:1039
Drupal.Ajax.commandExecutionQueue @ ajax.js?v=10.2.2:1036
Drupal.Ajax.success @ ajax.js?v=10.2.2:1095
e.success @ ajaxin.ajax.min.js?v=10.2.2:1
processReplacement @ big_pipe.js?v=10.2.2:84
checkMutationAndProcess @ big_pipe.js?v=10.2.2:110
(anonymous) @ big_pipe.js?v=10.2.2:129
processMutations @ big_pipe.js?v=10.2.2:128
drupal.js?v=10.2.2:64 Uncaught TypeError: Cannot read properties of undefined (reading 'matches')
    at content_translation.admin.js?v=10.2.2:64:25
    at Array.forEach (<anonymous>)
    at Object.check (content_translation.admin.js?v=10.2.2:57:43)
    at content_translation.admin.js?v=10.2.2:40:63
    at Array.forEach (<anonymous>)
    at Object.attach (content_translation.admin.js?v=10.2.2:35:50)
    at drupal.js?v=10.2.2:166:24
    at Array.forEach (<anonymous>)
    at Drupal.attachBehaviors (drupal.js?v=10.2.2:162:34)
    at HTMLAnchorElement.<anonymous> (ajax.js?v=10.2.2:1387:20)
(anonymous) @ content_translation.admin.js?v=10.2.2:64
check @ content_translation.admin.js?v=10.2.2:57
(anonymous) @ content_translation.admin.js?v=10.2.2:40
attach @ content_translation.admin.js?v=10.2.2:35
(anonymous) @ drupal.js?v=10.2.2:166
Drupal.attachBehaviors @ drupal.js?v=10.2.2:162
(anonymous) @ ajax.js?v=10.2.2:1387
each @ jquery.min.js?v=3.7.1:2
each @ jquery.min.js?v=3.7.1:2
insert @ ajax.js?v=10.2.2:1385
(anonymous) @ ajax.js?v=10.2.2:1046
setTimeout (async)
Drupal.throwError @ drupal.js?v=10.2.2:63
(anonymous) @ drupal.js?v=10.2.2:168
Drupal.attachBehaviors @ drupal.js?v=10.2.2:162
(anonymous) @ ajax.js?v=10.2.2:1387
each @ jquery.min.js?v=3.7.1:2
each @ jquery.min.js?v=3.7.1:2
insert @ ajax.js?v=10.2.2:1385
(anonymous) @ ajax.js?v=10.2.2:1046
Promise.then (async)
(anonymous) @ ajax.js?v=10.2.2:1039
Drupal.Ajax.commandExecutionQueue @ ajax.js?v=10.2.2:1036
Drupal.Ajax.success @ ajax.js?v=10.2.2:1095
e.success @ ajaxin.ajax.min.js?v=10.2.2:1
processReplacement @ big_pipe.js?v=10.2.2:84
checkMutationAndProcess @ big_pipe.js?v=10.2.2:110
(anonymous) @ big_pipe.js?v=10.2.2:129
processMutations @ big_pipe.js?v=10.2.2:128
drupal.js?v=10.2.2:64 Uncaught TypeError: Cannot read properties of undefined (reading 'matches')
    at content_translation.admin.js?v=10.2.2:64:25
    at Array.forEach (<anonymous>)
    at Object.check (content_translation.admin.js?v=10.2.2:57:43)
    at content_translation.admin.js?v=10.2.2:40:63
    at Array.forEach (<anonymous>)
    at Object.attach (content_translation.admin.js?v=10.2.2:35:50)
    at drupal.js?v=10.2.2:166:24
    at Array.forEach (<anonymous>)
    at Drupal.attachBehaviors (drupal.js?v=10.2.2:162:34)
    at HTMLUListElement.<anonymous> (ajax.js?v=10.2.2:1387:20)
(anonymous) @ content_translation.admin.js?v=10.2.2:64
check @ content_translation.admin.js?v=10.2.2:57
(anonymous) @ content_translation.admin.js?v=10.2.2:40
attach @ content_translation.admin.js?v=10.2.2:35
(anonymous) @ drupal.js?v=10.2.2:166
Drupal.attachBehaviors @ drupal.js?v=10.2.2:162
(anonymous) @ ajax.js?v=10.2.2:1387
each @ jquery.min.js?v=3.7.1:2
each @ jquery.min.js?v=3.7.1:2
insert @ ajax.js?v=10.2.2:1385
(anonymous) @ ajax.js?v=10.2.2:1046
setTimeout (async)
Drupal.throwError @ drupal.js?v=10.2.2:63
(anonymous) @ drupal.js?v=10.2.2:168
Drupal.attachBehaviors @ drupal.js?v=10.2.2:162
(anonymous) @ ajax.js?v=10.2.2:1387
each @ jquery.min.js?v=3.7.1:2
each @ jquery.min.js?v=3.7.1:2
insert @ ajax.js?v=10.2.2:1385
(anonymous) @ ajax.js?v=10.2.2:1046
Promise.then (async)
(anonymous) @ ajax.js?v=10.2.2:1039
Drupal.Ajax.commandExecutionQueue @ ajax.js?v=10.2.2:1036
Drupal.Ajax.success @ ajax.js?v=10.2.2:1095
e.success @ ajaxin.ajax.min.js?v=10.2.2:1
processReplacement @ big_pipe.js?v=10.2.2:84
checkMutationAndProcess @ big_pipe.js?v=10.2.2:117
(anonymous) @ big_pipe.js?v=10.2.2:129
processMutations @ big_pipe.js?v=10.2.2:128
drupal.js?v=10.2.2:64 Uncaught TypeError: Cannot read properties of undefined (reading 'matches')
    at content_translation.admin.js?v=10.2.2:64:25
    at Array.forEach (<anonymous>)
    at Object.check (content_translation.admin.js?v=10.2.2:57:43)
    at content_translation.admin.js?v=10.2.2:40:63
    at Array.forEach (<anonymous>)
    at Object.attach (content_translation.admin.js?v=10.2.2:35:50)
    at drupal.js?v=10.2.2:166:24
    at Array.forEach (<anonymous>)
    at Drupal.attachBehaviors (drupal.js?v=10.2.2:162:34)
    at HTMLAnchorElement.<anonymous> (ajax.js?v=10.2.2:1387:20)
(anonymous) @ content_translation.admin.js?v=10.2.2:64
check @ content_translation.admin.js?v=10.2.2:57
(anonymous) @ content_translation.admin.js?v=10.2.2:40
attach @ content_translation.admin.js?v=10.2.2:35
(anonymous) @ drupal.js?v=10.2.2:166
Drupal.attachBehaviors @ drupal.js?v=10.2.2:162
(anonymous) @ ajax.js?v=10.2.2:1387
each @ jquery.min.js?v=3.7.1:2
each @ jquery.min.js?v=3.7.1:2
insert @ ajax.js?v=10.2.2:1385
(anonymous) @ ajax.js?v=10.2.2:1046
setTimeout (async)
Drupal.throwError @ drupal.js?v=10.2.2:63
(anonymous) @ drupal.js?v=10.2.2:168
Drupal.attachBehaviors @ drupal.js?v=10.2.2:162
(anonymous) @ ajax.js?v=10.2.2:1387
each @ jquery.min.js?v=3.7.1:2
each @ jquery.min.js?v=3.7.1:2
insert @ ajax.js?v=10.2.2:1385
(anonymous) @ ajax.js?v=10.2.2:1046
Promise.then (async)
(anonymous) @ ajax.js?v=10.2.2:1039
Drupal.Ajax.commandExecutionQueue @ ajax.js?v=10.2.2:1036
Drupal.Ajax.success @ ajax.js?v=10.2.2:1095
e.success @ ajaxin.ajax.min.js?v=10.2.2:1
processReplacement @ big_pipe.js?v=10.2.2:84
checkMutationAndProcess @ big_pipe.js?v=10.2.2:117
(anonymous) @ big_pipe.js?v=10.2.2:129
processMutations @ big_pipe.js?v=10.2.2:128
drupal.js?v=10.2.2:64 Uncaught TypeError: Cannot read properties of undefined (reading 'matches')
    at content_translation.admin.js?v=10.2.2:64:25
    at Array.forEach (<anonymous>)
    at Object.check (content_translation.admin.js?v=10.2.2:57:43)
    at content_translation.admin.js?v=10.2.2:40:63
    at Array.forEach (<anonymous>)
    at Object.attach (content_translation.admin.js?v=10.2.2:35:50)
    at drupal.js?v=10.2.2:166:24
    at Array.forEach (<anonymous>)
    at Drupal.attachBehaviors (drupal.js?v=10.2.2:162:34)
    at HTMLUListElement.<anonymous> (ajax.js?v=10.2.2:1387:20)
(anonymous) @ content_translation.admin.js?v=10.2.2:64
check @ content_translation.admin.js?v=10.2.2:57
(anonymous) @ content_translation.admin.js?v=10.2.2:40
attach @ content_translation.admin.js?v=10.2.2:35
(anonymous) @ drupal.js?v=10.2.2:166
Drupal.attachBehaviors @ drupal.js?v=10.2.2:162
(anonymous) @ ajax.js?v=10.2.2:1387
each @ jquery.min.js?v=3.7.1:2
each @ jquery.min.js?v=3.7.1:2
insert @ ajax.js?v=10.2.2:1385
(anonymous) @ ajax.js?v=10.2.2:1046
setTimeout (async)
Drupal.throwError @ drupal.js?v=10.2.2:63
(anonymous) @ drupal.js?v=10.2.2:168
Drupal.attachBehaviors @ drupal.js?v=10.2.2:162
(anonymous) @ ajax.js?v=10.2.2:1387
each @ jquery.min.js?v=3.7.1:2
each @ jquery.min.js?v=3.7.1:2
insert @ ajax.js?v=10.2.2:1385
(anonymous) @ ajax.js?v=10.2.2:1046
Promise.then (async)
(anonymous) @ ajax.js?v=10.2.2:1039
Drupal.Ajax.commandExecutionQueue @ ajax.js?v=10.2.2:1036
Drupal.Ajax.success @ ajax.js?v=10.2.2:1095
e.success @ ajaxin.ajax.min.js?v=10.2.2:1
processReplacement @ big_pipe.js?v=10.2.2:84
checkMutationAndProcess @ big_pipe.js?v=10.2.2:110
(anonymous) @ big_pipe.js?v=10.2.2:129
processMutations @ big_pipe.js?v=10.2.2:128
drupal.js?v=10.2.2:64 Uncaught TypeError: Cannot read properties of undefined (reading 'matches')
    at content_translation.admin.js?v=10.2.2:64:25
    at Array.forEach (<anonymous>)
    at Object.check (content_translation.admin.js?v=10.2.2:57:43)
    at content_translation.admin.js?v=10.2.2:40:63
    at Array.forEach (<anonymous>)
    at Object.attach (content_translation.admin.js?v=10.2.2:35:50)
    at drupal.js?v=10.2.2:166:24
    at Array.forEach (<anonymous>)
    at Drupal.attachBehaviors (drupal.js?v=10.2.2:162:34)
    at HTMLAnchorElement.<anonymous> (ajax.js?v=10.2.2:1387:20)
(anonymous) @ content_translation.admin.js?v=10.2.2:64
check @ content_translation.admin.js?v=10.2.2:57
(anonymous) @ content_translation.admin.js?v=10.2.2:40
attach @ content_translation.admin.js?v=10.2.2:35
(anonymous) @ drupal.js?v=10.2.2:166
Drupal.attachBehaviors @ drupal.js?v=10.2.2:162
(anonymous) @ ajax.js?v=10.2.2:1387
each @ jquery.min.js?v=3.7.1:2
each @ jquery.min.js?v=3.7.1:2
insert @ ajax.js?v=10.2.2:1385
(anonymous) @ ajax.js?v=10.2.2:1046
setTimeout (async)
Drupal.throwError @ drupal.js?v=10.2.2:63
(anonymous) @ drupal.js?v=10.2.2:168
Drupal.attachBehaviors @ drupal.js?v=10.2.2:162
(anonymous) @ ajax.js?v=10.2.2:1387
each @ jquery.min.js?v=3.7.1:2
each @ jquery.min.js?v=3.7.1:2
insert @ ajax.js?v=10.2.2:1385
(anonymous) @ ajax.js?v=10.2.2:1046
Promise.then (async)
(anonymous) @ ajax.js?v=10.2.2:1039
Drupal.Ajax.commandExecutionQueue @ ajax.js?v=10.2.2:1036
Drupal.Ajax.success @ ajax.js?v=10.2.2:1095
e.success @ ajaxin.ajax.min.js?v=10.2.2:1
processReplacement @ big_pipe.js?v=10.2.2:84
checkMutationAndProcess @ big_pipe.js?v=10.2.2:110
(anonymous) @ big_pipe.js?v=10.2.2:129
processMutations @ big_pipe.js?v=10.2.2:128
drupal.js?v=10.2.2:64 Uncaught TypeError: Cannot read properties of undefined (reading 'matches')
    at content_translation.admin.js?v=10.2.2:64:25
    at Array.forEach (<anonymous>)
    at Object.check (content_translation.admin.js?v=10.2.2:57:43)
    at content_translation.admin.js?v=10.2.2:40:63
    at Array.forEach (<anonymous>)
    at Object.attach (content_translation.admin.js?v=10.2.2:35:50)
    at drupal.js?v=10.2.2:166:24
    at Array.forEach (<anonymous>)
    at Drupal.attachBehaviors (drupal.js?v=10.2.2:162:34)
    at HTMLAnchorElement.<anonymous> (ajax.js?v=10.2.2:1387:20)
(anonymous) @ content_translation.admin.js?v=10.2.2:64
check @ content_translation.admin.js?v=10.2.2:57
(anonymous) @ content_translation.admin.js?v=10.2.2:40
attach @ content_translation.admin.js?v=10.2.2:35
(anonymous) @ drupal.js?v=10.2.2:166
Drupal.attachBehaviors @ drupal.js?v=10.2.2:162
(anonymous) @ ajax.js?v=10.2.2:1387
each @ jquery.min.js?v=3.7.1:2
each @ jquery.min.js?v=3.7.1:2
insert @ ajax.js?v=10.2.2:1385
(anonymous) @ ajax.js?v=10.2.2:1046
setTimeout (async)
Drupal.throwError @ drupal.js?v=10.2.2:63
(anonymous) @ drupal.js?v=10.2.2:168
Drupal.attachBehaviors @ drupal.js?v=10.2.2:162
(anonymous) @ ajax.js?v=10.2.2:1387
each @ jquery.min.js?v=3.7.1:2
each @ jquery.min.js?v=3.7.1:2
insert @ ajax.js?v=10.2.2:1385
(anonymous) @ ajax.js?v=10.2.2:1046
Promise.then (async)
(anonymous) @ ajax.js?v=10.2.2:1039
Drupal.Ajax.commandExecutionQueue @ ajax.js?v=10.2.2:1036
Drupal.Ajax.success @ ajax.js?v=10.2.2:1095
e.success @ ajaxin.ajax.min.js?v=10.2.2:1
processReplacement @ big_pipe.js?v=10.2.2:84
checkMutationAndProcess @ big_pipe.js?v=10.2.2:117
(anonymous) @ big_pipe.js?v=10.2.2:129
processMutations @ big_pipe.js?v=10.2.2:128
trickfun’s picture

Any news here? it's impossible translate content.
Thank you

tobas1996’s picture

Hi!

I'm facing the same issue here with drupal 10.2.2.

When i open "Content language and translation" /admin/config/regional/content-language , when I select some of the "Entity type" checkboxes, it shows the entities down. BUT, when I save its not saving, and also I cannot see the fields
So i uncheck and check again the "collection type" checkbox but previous selections are lost.

Thank you.

trickfun’s picture

I have this error with this checkbox

<input id="edit-settings-media-audio-columns-thumbnail-file" class="form-checkbox form-boole…-boolean--type-checkbox" data-drupal-selector="edit-settings-media-audio-columns-thumbnail-file" type="checkbox" name="settings[media][audio][columns][thumbnail][file]" value="file">

something with file field.
I hope help

Thank you

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Artyom Hovasapyan’s picture

I found solution :). We must add !.

Artyom Hovasapyan’s picture

FileSize
597 bytes
Artyom Hovasapyan’s picture

FileSize
597 bytes
useernamee’s picture

Unfortunately the patch does not work for me. If I try to edit the fields of specific content/bundle, after saving the form all the fields are hidden and if I check and uncheck the bundle all the fields checked once again. I'm not even sure where the field data should be even saved after submitting the form.

Anyways I think that the data is correct even though once the form reloads you can't see which fields are (un)checked. I did de-select some paragraphs fields, saved the form and then checked the values that were visually hidden and the fields were (un)checked correctly as I set them.

I guess it is inconvenient not to be able to see the field settings but the configuration is saved correctly.

trickfun’s picture

I can't apply the patch on drupal 10.2.4.
thank you

le72’s picture

Artyom Hovasapyan’s picture

On drupal 10.2.4 has already fixed.
https://www.drupal.org/project/drupal/issues/3414415.

trickfun’s picture

I have 10.2.4 but is not fixed.
Checkbox doesn't show fields.

handkerchief’s picture

Priority: Normal » Major

I have 10.2.4 and the same problem:

  1. go to /admin/config/regional/content-language
  2. Check Content checkbox
  3. Check contenttype page and some different fields you wish to translate
  4. click on save
  5. Now all the fields of the contenttype page are hidden and the main checkbox of that type checked

it is impossible to translate the website, the settings are not saved.
No error in the logs, what the hell is going on?

handkerchief’s picture

This commit fixed the problem (after cache clear)
https://git.drupalcode.org/project/drupal/-/commit/61bc6f8e8cda4f708038c...

smustgrave’s picture

Can you check 11.x

Joe Huggans’s picture

Not sure if I am seeing the same issue but the patch did not work.

I am unable to make changes to the form at /admin/config/regional/content-language

For example, if I turn off translation for redirect, save the form, the page reloads and the translation for redirect is still turned on.

Drupal core 10.2.4