I'm creating a module (to be include in Open Atrium) which builds on top of workbench_moderation. It has it's own tables which refer to states and transitions, so it needs to be informed when states or transitions are saved or removed so that it can update its data too!

I'll attach a patch that implements both of these hooks in a moment (I just need the issue NID!).

Also, I've made a seperate patch for save hooks: #2195479: Add hook_workbench_moderation_(state|transition)_save() (Patches are now combined!)

Comments

dsnopek’s picture

Status: Active » Needs review
StatusFileSize
new3.25 KB

Patch is attached! Please let me know what you think.

srjosh’s picture

This is really good, but I think there's one more thing - shouldn't workbench_moderation_state_delete() also invoke the transition deletion hook, as it's deleting transitions?

dsnopek’s picture

@srjosh: Ah, yes, you're right! There should probably be some refactoring to avoid repeating that code. I'll take a look at it when I have chance.

srjosh’s picture

dsnopek’s picture

Issue summary: View changes
dsnopek’s picture

Title: Add hook_workbench_moderation_(state|transition)_delete() » Add hook_workbench_moderation_(state|transition)_(save|delete)
Issue summary: View changes
StatusFileSize
new7.01 KB

Even though both patches apply fine manually, Drush make has problems applying both the save and delete hook patches together, so I've merged them into one hook adding patch. :-)

srjosh’s picture

Status: Needs review » Reviewed & tested by the community

This is working beautifully on several different environments for me.

  • Commit f1157c1 on 7.x-1.x by srjosh:
    Issue #2175891 by dsnopek, srjosh: Add hook_workbench_moderation_(state|...
dsnopek’s picture

Woohoo! It's awesome to see this stuff starting to get committed. :-)

srjosh’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

firebug’s picture

can someone run me through a quick install guide for this patch.
I am running OA 7.19 and have enabled Workbench and Workbench Moderation but need to install this patch in order to enable OA Workbench

I have a local directory of the drupal code and Git it up to Acquia

Any plans to fold this into a stable module?
thanks
STeve