I know there is already a discussion to integrate workbench_moderation with node_revision_delete but it looks a really complex integration with some dashboards, etc. Please find a patch with a simple integration with the hook_workbench_moderation_transition. Each time a new revision is created, it will check all requirements (number of revision to keep) and delete revisions which must be deleted.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vbouchet’s picture

vbouchet’s picture

Assigned: vbouchet » Unassigned
vbouchet’s picture

Issue summary: View changes
vbouchet’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 1: 2248657-1-hook-workbench-moderation-transition.patch, failed testing.

vbouchet’s picture

I need to rework it as it was initialy designed for the 7.x-1 version.

vbouchet’s picture

Status: Needs work » Active
juampynr’s picture

@vbouchet, are you still working on this?

vbouchet’s picture

Hi Juampy,

No sorry I'm not working on it. Feel free to go ahead with it or tell me you want it for your release, I will try to find some time to adapt the patch to the new version.

Thanks,

DamienMcKenna’s picture

Status: Active » Needs work

The correct status is "needs work" rather than active.

vbouchet’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Needs work » Needs review
FileSize
944 bytes

Hi Juampy,

6 months later, I finally found some time to work on it.

Please find a patch to integrate with workbench_moderation. There is currently no specific option, that means each time a transition occurs on workbench moderation, the system is triggered and will remove oldest revisions (if exceeding the maximum number of revision).

Let me know if you want me to add an option somewhere to have it configurable.
I think we should move admin interface into a specific node_revision_delete.admin.inc file. Let me know if you are interested and I can provide a patch.

juampynr’s picture

Status: Needs review » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

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

hanoii’s picture

3 years later I happen to need this configurable, I wondered why my revisions were being deleted :scream: :). I wonder if at least it should avoid if the cron setting is set to never. Anyway, just noting it and adding myself here. Might come back to it but for now I can make do by disabling this module.

hanoii’s picture

Hmm, further looking into this I wonder why it was included at all. If cron was still going to take care of removing the revisions.

nelsongrin’s picture

@hanoii I agree with you, this should never have been included.

Please have a look to this issue where expose several problems Updating nodes deletes revisions and using a wrong hook.