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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Harry Slaughter’s picture

useful patch.

is workflow module abandoned? i see a huge queue and little activity.

jvandyk’s picture

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.

tanoshimi’s picture

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.

JacobSingh’s picture

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.

tanoshimi’s picture

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?

JacobSingh’s picture

Status: Active » Needs review
FileSize
3.62 KB

Here is a new patch, try to apply this and see if it works.

JacobSingh’s picture

FileSize
3.58 KB

Okay, let's try that one more time, this time, with testing!

tanc’s picture

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.

JacobSingh’s picture

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.

tanc’s picture

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)?

JacobSingh’s picture

FileSize
3.58 KB

Sorry, I screwed up an uploaded an old one.

tanc’s picture

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.diff
patching 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.

JacobSingh’s picture

Status: Needs review » Patch (to be ported)

Added in DRUPAL-5

deekayen’s picture

Status: Patch (to be ported) » Fixed

This made it in to 6.x-1.1 at the bottom of workflow.module.

Status: Fixed » Closed (fixed)

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