I'm making Rules integration for Revisioning. Rules is very powerful module, allowing to build very complex and powerful actions and behaviours without using single line of PHP. Currently Revisioning integrates with core Trigger module to provide core-style actions, but with Rules module Trigger becomes obsolete (actually I don't use Trigger at all).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

crea’s picture

Assigned: Unassigned » crea
RdeBoer’s picture

I also believe Rules has great potential.
Look forward to your thoughts in this area, crea.
Rik

crea’s picture

Status: Needs review » Active
FileSize
41.59 KB

"Release often, release early" as it they say...
So here comes first version of patch. Changes are very serious, and there can be bugs (actually i'm sure there are), so please review and test carefully. Rules stuff is complex so it would probably take ages for me alone to test it deeply enough, huh.
Setting to "critical" as this patch is big enough and it would be hard to reroll it every time against each dev version of Revisioning, if it doesn't get committed first.

Patch summary:

  1. Revision alerts printed during node (revision) view are now optional
  2. This is done via checkbox in "admin/settings/revisioning". Enabled by default, ofcourse.
    So there can be implemented other ways of alerting user (via template variable or custom block).

  3. Major Revisioning code changes:
  • Many functions were reworked, or split to smaller versions, to make them even more reusable.
  • New hook_revisionapi() hook is fired on different revision events. Other modules (including Revisioning itself) can use it to react on these events.
  • Several new helper functions implemented
  • Most reusable functions are moved to separate revisioning_api.inc file.
  • That code is slowly shaping up to be independant (so we could have module like RevisionAPI and Revisioning could be just UI module that uses API functions)

  • Rules integration:
    • Rules conditions: Content has pending revision, Content revision is one of (archived, current, pending)
    • Rules events: Node has been unpublished, Pending revision has been published, Node has been reverted to revision, Node revision is going to be deleted, Node is going to be reverted to revision
    • Rules actions: Publish the most recent pending revision, Load current revision of content (internal Rules action)

    Bug reports and Rules integration improvement ideas (new conditions, actions, events etc) are welcome.

    crea’s picture

    Title: Rules integration » Module rework and Rules integration
    Priority: Normal » Critical
    Status: Active » Needs review
    RdeBoer’s picture

    Status: Active » Needs review

    Hi crea,
    Really appreciate all the time you're putting into this. But as you suggested yourself let's not get ahead of ourselves and put patch on top of patch as it becomes really hard to merge.

    First things first. Both Module Grants and Revisioning have had their development versions mature for several weeks now with most of the issues ironed out, so I feel confident to make official releases of those this week.

    Then, returning to new development...
    I do like the idea of Rules integration and am happy to pursue it, but I feel a few other issues/patches are perhaps higher priority, eg:
    o #509552: "View Revisions" Permission does not descriminate by User Role
    o #513078: Flexible revision permissions.
    o #490580: 'access unpublished page/story/blog content' set of permissions
    o #492414: Tab stickiness (remember tab selection)
    and maybe also #505708: Set destination for revisioning links.
    Then I need to update the documentation too.

    I may be able to do some of the refactoring work you've suggested as part of the work required for the above.
    Small steps....

    Rik

    crea’s picture

    Well you could commit this to new experimental 3.x branch so atleast some brave people start testing it.

    RdeBoer’s picture

    Hi crea,
    Yes I could and I might, although I'm not a fan of maintaining two branches and move bug fixes across etc...
    For the moment I have created official releases of Module Grants and Revisioning and updated the doco, which frees me up to do some of things mentioned in #5, as well as your patch.
    Are you confident that the patch doesn't take away any functionality?
    And what are some of the Rules-based end-user features that you feel Revisioning will be able to offer?
    Rik

    crea’s picture

    Patch shouldn't take away anything, and if it does it's bug cause I didn't have such intention.
    If you want example for Rules: when revision is going to be deleted, check if acting user is moderator, and if he is not, copy revision somewhere. And that kind of "rule" could possible without writing code. Actually, possibilities are almost endless: it only depends on how creative we gonna be with "actions", "events" and "conditions" - that's why I asked everyone to share ideas.

    crea’s picture

    If you have problems with merging patches, I recommend using Git. Actually i'm newb to all VCS stuff and was amazed when Git merged several branches (with different features developed) without any intervention. It's such a timesaver, great tool.

    RdeBoer’s picture

    Thanks for the tips!
    Will check out Git ASAP.
    Rik

    kesmeby’s picture

    Sweet manna from heaven!

    I've been wishing Revisioning worked with Rules for months now while I bog down my development site with one cumbersome Workflow after another. Ugh!

    Great work on this module by the way. It really adds some important features.

    Thanks.

    RdeBoer’s picture

    @crea,

    Do you still have the source belonging to the patch you created in comment #4 ?
    If so, could you please generate another patch against the HEAD, as I'm not sure against which version of Revisioning your patch was created and some bug fixes had to go in since.

    @kesmeby, #11
    Thanks for your support!

    Rik

    crea’s picture

    Try this patch. Rerolled against latest dev

    RdeBoer’s picture

    Thanks crea -- give me 24 hours or so to evaluate.
    Then I'll make the current development snapshot official (it's soon, but it's a low risk change) and will check the patch into the repository for the next snapshot.

    RdeBoer’s picture

    Ok crea,
    Your patch is in as HEAD.
    The only changes I made are formatting changes to satisfy the Code review module.
    Rik

    crea’s picture

    Status: Needs review » Fixed

    Since this is now in CVS, I mark this as fixed. For bugs and feature requests regarding Rules integration new issues should be opened.

    Status: Fixed » Closed (fixed)
    Issue tags: -rules integration

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