Keep just one revision within a time interval periodically

Created on 30 March 2023, over 1 year ago
Updated 14 June 2023, over 1 year ago

Problem/Motivation

I'm not sure if I described it right in the title, but I think we need a plugin to just keep one revision within a time interval periodically.
So for example keep one revision a month. So for all month will remove all revisions just keeping one.

Steps to reproduce

Proposed resolution

Remaining tasks

Fix it.
Add test coverage.

User interface changes

API changes

Data model changes

Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

🇪🇸Spain edurenye

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

Comments & Activities

  • Issue created by @edurenye
  • @edurenye opened merge request.
  • 🇪🇸Spain edurenye

    Added the plugin and some tests.

    Do you think I should add more integration tests with all the 4 modules working together?

  • Status changed to Needs review over 1 year ago
  • 🇳🇱Netherlands seanB Netherlands

    Let me check, the "active" revision is always kept, so this plugin will keep 1 extra revision, but only if it is not older than a specific period? So if I specify a period of 1 month, we have the following:

    • Latest revision: today
    • Previous revision: 3 weeks ago

    Both revisions are kept.

    • Latest revision: today
    • Previous revision: 5 weeks ago

    The previous revision will be deleted and we only have the active revision.

    Is that a correct representation?

    To be honest, I think this is one of the reasons why we moved to plugins. This sounds like a very specific use-case, and adding this to the main module would add complexity for all users, which we should probably not want. I think there are a couple of options:

    1. This could easily be added to a custom module, in that case this is up to you (or others) to implement and maintain.
    2. We could potentially create a new project, a "node_revision_delete_extentions" module with a bunch of submodules to add plugins for advanced cases like this. That would keep the main module simple, but still allow non-developers to download/install the new project and take advantage of the Drupal community for more advanced cases.
    3. We could even add advanced use-cases as submodules to "node_revision_delete", but I'm not sure if the maintainers are willing to support the submodules and all the work that comes with maintaining them.

    For now, I'm leaning slightly towards option 1, and if someone is willing to maintain this, option 2 is also fine with me. We should probably validate the need for certain plugins through new projects, before we add more complexity to the main module. When a project has lots of usage, we could always decide later to incorporate it in the main module later.

  • 🇪🇸Spain edurenye

    Yes, your representation is correct.
    And I like the option 2 because that might encourage others to contribute with their own plugins and that would help others at the same time.

Production build 0.71.5 2024