This patch by itself will not do a lot. But together with these patches #244914: Preserve return value of an action and act before transition it provide support for when there is a need to do something before the node gets actually saved. Often, in these situations you want to actually block the state change. See the other issue/patch for information on how to do this.

Comments

miiimooo’s picture

Noticed that this doesn't work for scheduled workflow changes. Here's a patch that adds support for scheduled workflow changes.

@@ -2002,6 +2001,7 @@

       $values['workflow-current-state-name']                      =  $states[$row->sid];
       $values['workflow-old-state-name']                          =  $states[$row->old_sid];
+      $values['workflow-future-state-name']                       =  ( $states[$node->workflow] ? $states[$node->workflow] : $states[$node->_workflow_scheduled_sid] );

       $values['workflow-current-state-date-iso']                  =  date('Ymdhis',$row->stamp);
       $values['workflow-current-state-date-tstamp']               =  $row->stamp;
@@ -2027,6 +2027,7 @@
     $tokens['workflow']['workflow-name']                          =  'Name of workflow appied to this node';
     $tokens['workflow']['workflow-current-state-name']            =  'Current state of content';
     $tokens['workflow']['workflow-old-state-name']                =  'Old state of content';
+    $tokens['workflow']['workflow-future-state-name']                =  'Future state of content';
     $tokens['workflow']['workflow-current-state-date-iso']        =  'Date of last state change (ISO)';
     $tokens['workflow']['workflow-current-state-date-tstamp']     =  'Date of last state change (timestamp)';
     $tokens['workflow']['workflow-current-state-date-formatted']  =  'Date of last state change (formated - M d, Y h:i:s)';;

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