Provide a hook function to alter the skip fields in the hasTranslationChanges function in ContentEntityBase.php

Created on 6 July 2020, almost 5 years ago
Updated 7 April 2025, 18 days ago

Problem/Motivation

When using the multi-language website with the encrypted data field, we always get TRUE in hasTranslationChanges() even if we didn't modify the translation. The reason is the data stored in DB is [ENCRYPTED] instead of the real value. Which means we will always get the RevisionTranslatedAffected on all the languages when we update any one of the translation.

How to reproduce the scenario

1. Enable contribute module: https://www.drupal.org/project/encrypt
2. Enable multi-language settings on one of the content type. (EX: article)
3. Create a field with the encrypted type provided by the contributed module and check the field is translatable.
4. Create one article and translate the article with revision log filled with some text.
5. Check the column revision_translation_affected in node_field_data and node_field_revision database.

Proposed resolution

Provide the hook method to alter the skip fields that we can add our own skip fields when we run hasTranslationChanges()

Feature request
Status

Active

Version

11.0 🔥

Component

entity system

Created by

🇹🇼Taiwan cobenash Taipei

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024