Problem/Motivation

When the content moderation and the content translation module are activated and want to transform an entity to translatable, the option "hide non translatable fields on translation forms" from the url "/admin/config/regional/content-language" is checked and the widget is disabled, so you can not change it.

I understand that this is because the non-translatable fields do not allow revisions.

On websites with multiple languages, where there can be one or more editors for a specific language, could be interesting to allow a second option: instead of hiding the fields, disable the non-translatable fields but showing the values, to give a clue of the default translation value to user editing the content.

It could be problematic with some custom or non-core widgets that don't support the "#disabled" attibute, but all or most of core Form API elements are compatible with the "#disabled" attribute.

Proposed resolution

  • Give the option to disable non-translatable fields instead of hide non-translatable fields
  • Disable non-translatable fields on entity translation edit/add form
  • Example of radiobuttons with content_moderation disabled:

    Example of radiobuttons with content_moderation disabled
  • Example of radiobuttons with content_moderation enabled:

    Example of content translation interface

Remaining tasks

Create a patch.

User interface changes

On the mentioned admin form the options should change as well as the entity add/edit forms. See "Proposed resolution" section.

API changes

None.

Data model changes

The configurtion entity related to this form will change. This may need an update function.

Issue fork drupal-3222997

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

eduardo morales alberti’s picture

Title: Disable instead hide non translatable fields on translation forms » Allow disable non translatable fields on translation forms
tunic’s picture

Issue summary: View changes

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.1.10 (June 4, 2021) and Drupal 9.2.10 (November 24, 2021) were the last bugfix releases of those minor version series. Drupal 9 bug reports should be targeted for the 9.3.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

eduardo morales alberti’s picture

Status: Active » Needs work

mauricio.galindo made their first commit to this issue’s fork.

mauricio.galindo’s picture

A new option was added on /admin/config/regional/content-language
new option disable fields
And with this option the fields are disabled on translatable content entities in the alter form only for translation forms

mauricio.galindo’s picture

Status: Needs work » Needs review
rinku jacob 13’s picture

StatusFileSize
new72.61 KB
new78.02 KB

Reviewed and tested the patch#8 for drupal 9.3.x-dev. It's look good for me. Thanks@mauricio.galindo. Adding screenshot for the reference.

rinku jacob 13’s picture

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

j-vee’s picture

Tested and everything works well! Thanks for the patch.

Manibharathi E R’s picture

StatusFileSize
new272.82 KB
new271.68 KB

Patch #8 Applied and tested successfully on Drupal 9.4.x.

Before Patch:
Before-Patch

After Patch:
After-patch

jasonawant’s picture

Issue summary: View changes
StatusFileSize
new3.75 KB
new1.09 KB

I came across this issue b/c I was looking for alternatives to the "Hide non translatable fields on translation forms" for entity reference fields.

I tested the above patch, but did not observe my expected "disable" behavior on the untranslatable fields. I've made suggested to the MR and uploaded a new patch with interdiff.

I think it an improvement for content authors that have previously experienced the hidden version. However, it's probably still confusing for content authors. May need to take this a step further an alter the "(all languages)" suffix added to field labels via ContentTranslationHandler::addTranslatabilityClue() here.

jasonawant’s picture

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative, +Needs tests

This 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.

Tagging for needs tests

Version: 9.5.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.

tuwebo changed the visibility of the branch 3222997-allow-disable-non to hidden.

tuwebo changed the visibility of the branch 3222997-allow-disable-non to active.

oily made their first commit to this issue’s fork.

oily’s picture

Tried to create a new 11.x branch using Drupal.org instructions but too many conflicts that had to be resolved by editing. Abandoned attempt.

Seems we need to create a new MR based on 11.x.

laurielim made their first commit to this issue’s fork.

laurielim changed the visibility of the branch 11.x to hidden.

laurielim changed the visibility of the branch 10.0.x to hidden.

laurielim’s picture

Created a branch from 11.x and applied the changes from patch #15 to the latest version.

Here is also a patch for 11.2.10, before content_translation.admin.inc deprecation.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.