Added Token support for Workflow
JacobSingh - July 6, 2007 - 01:04
| Project: | Workflow |
| Version: | 5.x-1.1 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | JacobSingh |
| Status: | closed |
Description
I've created a token_workflow.inc to handle a few variables via the workflow module, should this be included with workflow or in token?
See: http://drupal.org/node/157187

#1
useful patch.
is workflow module abandoned? i see a huge queue and little activity.
#2
I'm in the midst of a vast porting project. Once the project is on Drupal 5, it will use workflow. Then I will be able to justify spending time on it.
#3
Sorry for such a daft question, but what do I need to do/ where do I need to place this token_workflow.inc file in order to be able to make use of the new tokens it defines?
I've put it alongside the existing .inc files in the token module directory, but it hasn't replaced any of the defined tokens. Do I need to edit token_include() in token.inc to include it?
thanks.
t.
#4
Hi Tanoshimi, it does in fact need to be included manually (either from workflow.module or anywhere else in your code base). I made an inc rather than another module because it belongs as part of workflow.
#5
Thanks for the advice - I've tried to include() this file in my existing workflow.module but I must have not done something right because using tokens such as [workflow-current-state-name] in autonodetitle of a node type which had workflow states defined didn't replace the token....
Then I even tried just copying and pasting the workflow_token_list() and workflow_token_values() functions directly into the workflow.module file, and that didn't work either...
Sorry to bother you, but any ideas how I can go about troubleshooting what I might have done wrong?
#6
Here is a new patch, try to apply this and see if it works.
#7
Okay, let's try that one more time, this time, with testing!
#8
JacobSingh, can you explain a little more about what your patch does and how to implement it?
So far I've had trouble applying the patch against either the CVS or the main release of the workflow.module. I've also pasted it into the end of the module and no errors are thrown but it doesn't seem to be working. From what I can tell there should be a whole load of workflow tokens available to other modules but I'm not seeing them in the lists, the only one that is listed is 'workflow-name'.
I'm particularly interested in integrating the Workflow-ng and Workflow modules using this patch to detect states in Workflow from Workflow-ng. Any advice is greatly appreciated.
#9
Hi Tank,
which patch did you apply? I uploaded a couple of them without good testing. Try the last one, and install pathauto 5.2.2, that uses tokens and I tested with it.
#10
Thanks for replying so quick! I've tried to apply the latest patch you uploaded on the 28th (today) but with no success. If I copy and paste from the provided diff file (getting rid of all + signs) the module appears to partially work in that one new token pattern appears.
I have Pathauto installed and when checking through the token list (replacement patterns) for node path settings I only see one new item called 'workflow-name'. Should I be seeing all the rest (workflow-state etc)?
#11
Sorry, I screwed up an uploaded an old one.
#12
Awesome, that worked fine when I copied and pasted to the end of workflow.module. Now all the additional replacement patterns are showing up. Your patch file still doesn't want to work for me, I'm not sure if its something I'm doing wrong. I get the following error message after patching with this command:
$ patch < workflow_tokens.diffpatching file workflow.module
patch unexpectedly ends in middle of line
patch: **** malformed patch at line 85:
Anyway, thanks for submitting this patch, I'll now have a play with the new tokens.
#13
Added in DRUPAL-5
#14
This made it in to 6.x-1.1 at the bottom of workflow.module.
#15
Automatically closed -- issue fixed for 2 weeks with no activity.