Problem/Motivation

On the storage level revisions are not created just for a single translation of an entity, but for all translations. Because in the UI the field values are only edited for a single language, however, we calculate which translations are actually affected by this new revision, which means which translations actually have field values which differ from the previous revision.

We use this value in two places in core:

  1. In the node revision overview revisions whose translations in the current language are not affected are hidden, so as not to confuse the user by showing them multiple revisions that are visibly indistinguishable
  2. For entities that moderated with the Content Moderation module, the Latest version tab is only shown,
    if the translation in the current language of the latest version is actually affected

The problem is that when re-saving the same revision (i.e. when unchecking the Create new revision checkbox), the information which translations are affected by this revision is not being recalculated. Therefore this information may be invalid leading to misinformation wherever this information is accessed including the two places in core depicted above.

This capability was introduced in #2453153: Node revisions cannot be reverted per translation but the impacts of re-saving an existing revision were not discussed throughout the entirety of that issue.

Proposed resolution

When saving an entity and not creating a new revision, compare the field values of each translation to those of the previous translation and (re-)calculate which translations are affected by this revision.

Comments

tstoeckler created an issue. See original summary.

tstoeckler’s picture

hchonov’s picture

Resaving a revision without creating a new one is a bad thing :). If you update the revision translation affected flag then what will you do with the next revision based on the one you are currently saving? Following this logic we have to resave all the revisions till the last one in order to update the metadata.
Also another problem - when you create a new revision it is compared with original which is usually the previous one, but this is not necessary, so the revision translation affected flag is calculated based on the revision we are deriving from. There is the question on revision resave what do you use as original - the revision we've derived from or the current one?

I think that we should fix this only when we resave the current default revision without creating a new one but still here is the question what do we compare against.