hook_workflow - delete before execute (Not possible to schedule another transition)

meba - April 5, 2009 - 12:00
Project:Workflow
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Issue tags:workflow
Description

Hi,
in workflow_execute_transition():

  // Notify modules that transition has occurred. Actions should take place
  // in response to this callback, not the previous one.
  module_invoke_all('workflow', 'transition post', $old_sid, $sid, $node);

  // Clear any references in the scheduled listing.
  db_query('DELETE FROM {workflow_scheduled_transition} WHERE nid = %d', $node->nid);

This means that the hook is run before the transitions are deleted from the table. Result - i can't respond to a state transition in the hook by scheduling another transition, because the code will delete it immediatelly.

It should be fairly simple to just switch both lines...

AttachmentSize
workflow_transition.patch1.25 KB

#1

meba - May 30, 2009 - 19:40

Adding a tag

#2

meba - November 7, 2009 - 10:20

Is anybody interested in this issue?

 
 

Drupal is a registered trademark of Dries Buytaert.