Closed (fixed)
Project:
Workflow
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
6 Feb 2009 at 10:28 UTC
Updated:
3 Jan 2014 at 00:07 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
alanburke commentedSubscribe.
Will hopefully get a chance to test sometime soon
Comment #2
leoklein commentedThanks. This is great!
Comment #3
crea commentedSame as #257833: When saving a node, the workflow ng transition rule is triggered, even though workflow has not changed
I think that checking tokens in Rules is ugly.
What about 2 Rules events:
This needs some more thought, so setting it to "needs work"
Comment #4
crea commentedHere is updated module. Changes from original port posted in this issue:
No more comparing tokens to find out!
It is invoked when workflow is updated with comment, but no state change happened.
Note 1: in case workflow state has changed and comment was added at the same time only "Workflow state has been changed" rule will be invoked, not both.
Note 2: currently it is commented in module code, because for proper work it requires patch #472966: Avoid execute_transition twice (when using Rules, Actions) (see comments in module code).
Comment #5
klausiI will work on the Rules integration during my Google Summer of Code project.
* I will recycle your code and extend it
* I will provide valid patches against the Workflow CVS dev branch
* I think we do not need a separate module. I will let the code live in a workflow.rules.inc file
Comment #6
crea commentedGreat news.
Too bad your patches won't be commited cause workflow seems to be unmaintained. So if you intend to make it part of Workflow, obtain commit access also, hehe...
Comment #7
klausiHere is a first patch. Currently there is only one event that occurs if a transition to a different state has been made. A condition is also included to check the transition states.
TODO:
* Add event for non-state-changing transitions with comments
What other events, conditions and actions would you like?
Comment #8
klausiNew patch:
* Added event for workflow comments only (also added
unset($node->workflow_comment);to avoid double execution of a state transition, inspired by #472966: Avoid execute_transition twice (when using Rules, Actions)).* Also added
$node->workflow = $sid;after the transition to avoid the double execution.Comment #9
crea commentedI think you should not put fix from #472966: Avoid execute_transition twice (when using Rules, Actions) inside this patch, because duplicate runs is different problem, not just local to Rules integration and that patch in #472966: Avoid execute_transition twice (when using Rules, Actions) also should fix subsequent duplicate runs for other modules.
Stating that Workflow integration requires that patch would be enough.
Comment #10
klausiOK, I added a patch suggestion in #472966: Avoid execute_transition twice (when using Rules, Actions).
This patch here depends on my patch there, so apply the other patch first.
Comment #11
klausiNew patch to fit for #472966: Avoid execute_transition twice (when using Rules, Actions).
Comment #12
fagoI applied the patch from http://drupal.org/node/472966#comment-1906724 and give this a test. I tried both events, the condition and also using the core action with rules - works as it should :) Also code style is looking fine, so I set this to RTBC.
Having this integration would help the user that want to use workflow with rules (see #396086: Help using Workflow's states with Rules) a lot, till know users relied upon tokens to detect workflow transitions. Having the separate condition of this patch is much better.
Comment #13
gagarine commentedtrack
Edit: After all i use trigger (integrated in D6 core & with workflow) to fire rule sets.
Comment #14
csc4 commentedTracking
Comment #15
gagarine commentedI try patch #11 with #9 on #472966: Avoid execute_transition twice (when using Rules, Actions) .
All seem to work fine thanks
2 feature requests:
- access to the "unchanged content" on the event "workflow state has change".
- on the event "content is going to be saved" a condition to check the value of the new workflow sate.
Edit: perhaps this bug can help #327144: workflow-state tokens are reversed
Comment #16
hefox commentedGreat patch;
For the lazy minded that don't want to add ORs for each potential state, the which state could be a multi select under "check workflow state"
Attached patch changes that, haven't tested heavily. (assumed patch 11 applied, ie doesn't include 11).
Comment #17
hefox commentedI've had some issue with this, same as in #445084: Adjust module weight from 0 however adjusting weight did not help. The triggered rule was returning the $node in the array('node'=>$node) format to resave in a 'custom php' do action. (The rule was set up to set published, changed date to now when workflow state changed to my 'published' state).
Comment #18
hefox commented(Nevermind, probably the subsquent patch will fix it).
Comment #19
miro_dietikerI've had an ugly issue with this patch: http://drupal.org/node/616664
Indeed it was only with the single selectable implementation from klausi nr 11... where too strict checks led to this issue.
Rules integration checked for === between numbers as string and numbers as int - whereas they where treated unidentical
Switching to the multiple selectable version containing checks with in_array led to a perfect working solution.
I'm going to submit a new patch containing checked workflow.module rules integration with multiple support (11 and 16) with tiny formatting corrections. This patch should really be production ready and candidate for CVS now.
Rerolled against current -dev of today, with need to change one hunk.
Comment #20
miro_dietikermaking it unassigned.
Comment #21
shawn dearmond commentedI applied #19 to 6.x-1.3 and it worked great. Thanks!
Comment #22
designerbrent commentedWhat needs to happen to get this committed?
Comment #23
crea commentedWell..the module needs active maintainer. Seems to be unsupported.
Comment #24
Encarte commentedsubscribe
Comment #25
infojunkiesubscribe
Comment #26
mxtsubscribe
Comment #27
jvandyk commentedApplied to 6.x-1.x-dev along with most of http://drupal.org/node/472966#comment-1906724.
Comment #28
bakr commentedhave anyone been successful in running
workflow 6.14
along with drupal 6.16
along with rules integration for workflow
I seem to get error message about a function override issue
Now I got it.. the Dev version simply works
Now the taxonomy assignment of Current and Old is working properly... sure it is fixed.
Within the Rules module, just use the textual comparison and compare the state tokens with state names.
I also deleted the above mentioned integration module from the modules directory, as no more need for it, and was causing funtion override issue.
Comment #29
mxtI've noticed that there's only a "Check workflow transition" condition available, but I'd need a condition like "content has workflow status" to check if a content is in a particular workflow status.
Thank you
Comment #30
crea commented@MXT
please don't reopen old threads. Your question sounds like a feature request so please open a separate one. Thank you.