Problem/Motivation

At present Revision Manager calculates number of revisions to keep cumulatively for all languages enabled on the site. it produces inadequate results for entities with multiple translations available.

Scenario: node has 2 translations in addition to the original language, 3 all together. Each translation has its own revisions, when Revision Manager is calculating what to remove it keeps let's say 10 latest revisions for all three languages counted together. So, original language can have 6 revisions kept, one translation 3 revisions and another translation only a single revision left because it wasn't touched for a while.
Expected behavior would be that RM leaves 10 last revisions for each translation.

Proposed resolution

Change algorithm so it keeps configured number of revisions PER TRANSLATION, instead of the current "per entity" logic.

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

jura.khrapunov created an issue. See original summary.

j-barnes made their first commit to this issue’s fork.

j-barnes’s picture

Version: 1.0.0-beta2 » 1.0.x-dev
Assigned: Unassigned » j-barnes
Status: Active » Needs review
StatusFileSize
new9.5 KB

Thanks for writing this up, was super helpful.

I added a MR and will post a patch as well. Revisions are now counted per translation using revision_translation_affected instead of cumulatively across the entity. Added some multilingual tests to cover the behavior.

Going to get our internal team to test it out early next week. If you get a chance to try it on your setup before then let me know how it goes.

jura.khrapunov’s picture

It seems it does the job nicely! I've tested it on the real database and now versions are preserved per-language which is exactly what we wanted.
Kudos, @j-barnes, thanks for the swift turnaround.

sunny-lee’s picture

Status: Needs review » Reviewed & tested by the community

This looks great! I also tested on our sites with Spanish and Korean, and successfully kept the set number of revisions (5) for each of these languages separately from English. So instead of 5 total for all 3, there are 15, 5 for each language. Created a new media entity and tried with that as well with success.

  • j-barnes committed eecfe002 on 1.0.x
    Issue #3561769: Added per-translation revision counting for multilingual...
j-barnes’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone for the help on this!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.