The goal of this task to interface node_revision_delete and workbench_moderation modules.

So that the number of revisions stored by WBM is controllable by the sites admin.

The proposed action plan is:

NRD:

  1. Patch node_revision_delete to allow for rules integration where revision_deletion is an action. Using views to generate the list(s) of Node Revisions to be delete.
  2. Patch node_revision_delete to add a hook that let's other modules add options for revisions to protect and WBM could implement that hook
    hook. (i.e. let's other modules add options for revisions to protect - rules conditions)

WBM:

  1. Patch WMB to allow for the new hook and the rules to be built.
  2. Build a default set of rules that other WBM users can leverage.

Comments

jwilson3’s picture

I think perhaps this feature should be built into this module, as a feature request... We might include the similar options from the Revision Deletion module:

Possible settings include node type, the age of node revision before being deleted, along with a Cron frequency setting.

I propose the settings be on a per-content type basis, using the content type edit screen vertical tabs and the variable table with appropriate content type machine name in the variable names to store the settings.

This module will NEVER delete the current revision of a node, nor will it allow you to do so.

^ I propose we amend this to say "NEVER delete the current and/or published revisions of a node".

There is also the special case to watch out for with Workbench Moderation where the "published" revision is not the most recent revision, and there can be more recent unpublished "latest revisions"; so it really does make the most sense to come up with a custom solution that offered a couple options, specific for this module:

Which nodes?

  • [Number] Only prune nodes that have more than [__________] revisions. [Number field, empty by default].

How much?

  • [Number] Only delete revisions created over [_____] days ago.
  • [Number] Leave [_________] most recent revisions in place. [Number field, empty by default].
  • [Multi-select] Delete revisions in the following states only:
    - Draft
    - Needs Review
    - My custom state 1
    - My custom state 2
    (Note that "Published" is left off from this list on purpose).
  • [Checkbox] Leave new revisions. [unchecked]
    - This leave in place any revisions that are newer than the currently published version, if any exist. Leaving this unchecked will perform the default behavior to prune *all* revisions except for the Published and Current Revision. Note, this setting overrides the "X most recent revisions".

When?

  • [Number] Wait [___] days between each revision pruning.
HyperGlide’s picture

Category: support » feature

@jwilson3 Thank You ++

I agree that this feature should be within the workbench_moderation module. Perhaps a submodule but within the suite.

I agree with your summary completely and am glad you pointed out the special case.

I have seen you have contributed other patches to workbench_moderation. Can you perhaps express the complexity or efforts required to complete this work? I am not a coder but ready to help get this feature built.

I would also comment that this feature should try to be built in a fashion that it can be applied to the 1.x and 2.x branch. (However I am partial to the 1.x ;-)

Thanks!
Hg

HyperGlide’s picture

Any ideas on how to begin to create a patch for this feature request. thank you

jwilson3’s picture

This seems like a pretty big endeavor and I'd like to see some buy in or feedback from a maintainer who knows more about the issue and can guide the development on this new feature request in some meaningful way.

mordonez’s picture

I'm interested to help with this feature request

HyperGlide’s picture

@mordonez wonderful. I have tried to find the modules developers in IRC to discuss. However have not been able to connect.

If possible I would encourage you to discuss point #4 to get their buy in on the feature request and any guidance on implementation approach.

Thanks!
Hg

HyperGlide’s picture

Was able to catch @stevector on IRC and he had the following key points to share.

  • Lets not duplicate another existing module as a new feature into Workbench_Moderation.
  • Believes it is helpful to restrict deletion of old revisions based on Workbench moderation data.

He also offered some ideas on how to proceed:

  1. Make use of the workbench_moderation data and rules to help control what content would and would not be deleted. (i.e. "don't delete node revisions that match conditions X, Y, Z"
  2. Perhaps add a hook that let's other modules add options for revisions to protect and WBM could implement that hook

Of the (2) modules listed I would say to make use of node_revision_delete as it already has a 7.x branch.

I would also propose the following for discussion:

  1. Patch node_revision_delete to allow for rules integration where revision_deletion is an action.
  2. Patch node_revision_delete to add the hook as noted above. (i.e. let's other modules add options for revisions to protect - rules conditions)
  3. Patch WMB to allow for the new hook and the rules to be built.
  4. Build a default set of rules that other WBM users can leverage.

Thoughts please?

stevector’s picture

Yeah, I think this has to start with a change to Node Revision Delete. Here's another idea for making Node Revision Delete more configurable: use Views to generate the list(s) of Node Revisions to be delete. This would let you target revisions by anything Views is aware of including WBM data.

jwilson3’s picture

That sounds like a solid way forward. We need buy in from NRD maintainer. Should we just clean up issue summary and title, and put this issue over in the NRD issue queue for comment #7 steps 1 and 2, and then change it back to the WMB issue queue when those steps have been completed?

HyperGlide’s picture

Title: Solution For Removing - Deleting - old Node Revision » Integrate support for node_revision_delete and workbench_moderation.
Project: Workbench Moderation » Node Revision Delete
Version: 7.x-1.2 » 7.x-1.x-dev

@jwilson3 - Thank you for the continued help and support. Apologies for the delay as was celebrating the Chinese New Year. (Snake Year)

I agree with your suggestion and have:

  1. Moved the issue to the NRD Queue.
  2. Will send an email to @kaushalrahuljaiswal the NRD maintainer about this issue and plan to ask for his buy in.
  3. I have also updated the Issue Title and Summary to help this be a bit clearer for other to understand the 'feature request' goals.

@jwilson3 - are you able to help with the first steps from #7.

  1. Make use of the workbench_moderation data and rules to help control what content would and would not be deleted. (i.e. "don't delete node revisions that match conditions X, Y, Z"
  2. Perhaps add a hook that let's other modules add options for revisions to protect and WBM could implement that hook
HyperGlide’s picture

Issue summary: View changes

Updated Summary based on accepted solution.

HyperGlide’s picture

Posting that #1063266: Revision Deletion - Alternatives for Drupal 7 was recently updated and seeing if there is any renewed interest for this thread.

HyperGlide’s picture

Bump - any interest in this.

aanjaneyam’s picture

Yes I am very much looking forward to it. I may help test it as I am not competent in coding.

aanjaneyam’s picture

Issue summary: View changes

Removed extra li.

thijsvdanker’s picture

Issue summary: View changes

I've started a sandbox project to address this issue:
https://drupal.org/sandbox/thijsvdanker/2232315

This code could either be integrated in this module, or be used as a standalone module.
Please review and let me know what you think!

DamienMcKenna’s picture

FYI there's also some effort to add some slightly more limited integration: #2248657: Implements hook_workbench_moderation_transition

adriancid’s picture

Status: Active » Postponed

We are trying to migrate the module to Drupal 8, version of this module:

For the moment we will stop the new features in the 7.x branch because we are adding new features in the 8.x version and once it will be finish we will add the new features to the 7.x branch.

If you can help me in the migration, take a look here:

https://github.com/adrian-cid/node_revision_delete/projects/1

and here:

#2808383: Node Revision Delete Drupal 8 port

adriancid’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
solideogloria’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
adriancid’s picture

Status: Postponed » Active
adriancid’s picture

Status: Active » Closed (won't fix)