Apologies if this is a simple question - I'm just getting to grips with workflow and actions and I'm loving the potential opportunities they provide, but not entirely successfully harnessing them!

Like many people it seems, I've created a workflow (called publication status) with two states for draft and published, with attached actions of unpublishing the node on creation-> draft, and publishing it when state changes from draft->published.
I want to use this workflow particularly in connection with the blog node type to enable me to write a batch of blog nodes now and schedule them to be published individually on given dates in the future. This actually works really well at the moment, but in order to set the schedule for the node publication I seem to have to submit the node first, and then go back in to edit it to be able to access the 'Publication Status' section where I can set the schedule for the state change from draft to published.

Am I missing something, or should I be able to set the schedule when I am creating the node?

Thanks for any help.

CommentFileSizeAuthor
#18 workflow_change_and_schedule.patch4.95 KBjohnv

Comments

tanoshimi’s picture

Title: Access to workflow states at point of node creation, rather than just editing existing nodes? » Access to workflow state schedule at point of node creation, rather than just when editing existing nodes?

Just changing the title of the issue - it's specific to setting the schedule when the workflow state can be changed in the future, rather than setting the workstate itself when the node is created (I can do this)

hillaryneaf’s picture

You already have the role able to move something from creation to draft. Did you set the role to be able to move something from creation to published. I would think that would allow you to schedule the publish state change the first time you create the node. Of course then it might be sitting in limbo somewhere as it would only be in 'creation' stage, not 'draft' nor 'published'.

tanoshimi’s picture

Thanks for the response - I don't think it's to do with permissions of the role, because I can go back in to edit the node immediately after it's created using the same user and then the workflow tabs are available.

I think your second suggestion is more accurate - a node cannot be assigned a workflow status on creation, because at that point it is not yet a node - there is no nid assigned which can be used in the workflow management....

Having said that though, scheduler module allows new nodes to be scheduled on creation using a similar mechanism, so there must be a way around it.... oh well.

Anonymous’s picture

I too am wondering about this. Scheduling a workflow transition at the point of node creation would be very handy (and less confusing). Only being able to do so after creating the node and going to Edit is very user unfriendly...most users probably would not even realize they could schedule.

mglover’s picture

Any progress on this? I'd also like to be able to schedule a workflow transition during node creation, cutting out the extra step.

janusman’s picture

subscribing

Sean Buscay’s picture

Hello tanoshimi, mglover , and janusman:

I've illustrated a sort of programmatic semi work around in this blog post:

http://treehouseagency.com/blog/sean-buscay/2008/10/24/building-publishi...

I hope it might help. If you have any specific questions I might try to answer, feel free to ask.

Best Regards,
Sean Buscay

andrewsuth’s picture

Brilliant work and well documented.

Hats off to you!

jpbhat’s picture

Hello all

i am also facing same problem in work flow
i have create publishing work flow with state as draft,review,rework,unpublished and published and created a n action for that my question is if i change the state from unpublished to publish state why the content remains in not published state weather i am doing wrong thing or should we click on publish in publishing option inorder to publish the content please any one could suggest an idea how to do automating publishing and un publishing of content using work flow

Bastlynn’s picture

Status: Active » Closed (won't fix)

Hi,

With the release of Drupal 7, Drupal 5 is no longer receiving security updates, reviews, or development from many contributed modules. Since 5 is now considered a depreciated version, you really should seriously look into upgrading to Drupal 6 or 7. The newer versions of Drupal work better, have more support, and will be safer (literally! security patches!) for your website. We are currently working on a new release for Workflow to Drupal 7. In light of that, further support for Drupal 5 issues is infeasible at the moment. Please consider upgrading to Drupal 6 or 7 in the near future - you'll be glad you did.

- Bastlynn

unic’s picture

Version: 5.x-1.1 » 7.x-1.x-dev
Category: support » feature
Status: Closed (won't fix) » Active

Scheduling a workflow transition at the point of node creation would be very handy in D7 version too.

johnv’s picture

It is deliberately hardcoded to not allow scheduling upon node creation. See this comment in the code:

function workflow_node_form(..) {
  ...
  // Display scheduling form only if a node is being edited and user has
  // permission. State change cannot be scheduled at node creation because
  // that leaves the node in the (creation) state.
  ..
}

We need to have an answer to the following question, first:
"If the scheduled state is set on the Node Creation page, what state will the new node have directly after saving?"
#7 has a workaround.

johnv’s picture

Title: Access to workflow state schedule at point of node creation, rather than just when editing existing nodes? » Add ability to schedule a State change at node creation (not only when editing existing nodes)
nancydru’s picture

Personally, I would rather not have workflow on the node edit form at all.

johnv’s picture

Crossposting: below issues both regard the situation "change immediate state, while having a scheduled transition":
#2097401: Multi review
#189572: Add ability to schedule a State change at node creation (not only when editing existing nodes)

johnv’s picture

I've added this to a meta issue:
#2144747: [META] Flexible transitions

colan’s picture

Issue summary: View changes
Parent issue: » #2144747: [META] Flexible transitions
johnv’s picture

StatusFileSize
new4.95 KB

Marked #737738: Add ability to schedule a State change at node creation (not only when editing existing nodes) (II) as duplicate. Since it contains a patch, I repeat it here:

Posted by Josh Waihi on March 10, 2010 at 1:45am
Currently there are two ways to make a transition; immediately or at a given date and time. However there is a need to be able to make a transition both immediately and another transition at a later date and time.

For example, lets say we're using workflow for task assignment priorities. We may want to lower the priority for now but push the priority at a later time. Rather than having to do this in two steps we should be able to do this in one.

I've attached a solution I'm using at the moment. Though it could do with some UI improvments (so could the existing implementation for that matter!) Mayebe this should be a configuration to turn on?

johnv’s picture

In general, if you have only 2 states, I wouldn't use Workflow, but Scheduler.

merilainen’s picture

This would be useful if some of the content needs to follow workflow, but some should be published scheduled without workflow. Currently the content has to be saved before it can be scheduled for publication for example.

johnv’s picture

nancydru’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
johnv’s picture

Version: 7.x-2.x-dev » 8.x-1.x-dev
johnv’s picture

Status: Active » Closed (outdated)

ITMT, in version 8.x, some features have been added.
- hooks in workflow.api.php
- events directory src/Event, including some example code.