[development] View to list only nodes _without_ completed workflow state

Simon Lindsay simon at dirtbike.ws
Sat Feb 18 03:04:49 UTC 2006


Earl Miles wrote:
> Ok, this is definitely a bug, and jvandyk and I are discussing the best 
> way to fix it.

Bummer, but thanks!

This is the code used in the workflow module to get the current state.

function workflow_node_current_state($node) {
   $sid = db_result(db_query("SELECT sid FROM {workflow_node} WHERE 
nid=%d ".
     "ORDER BY start DESC LIMIT 1", $node->nid));
   if (!$sid) {
     $wid = workflow_get_workflow_for_type($node->type);
     $sid = _workflow_creation_state($wid);
   }
   return $sid;
}

I guess the view needs to be able to limit the query results from the 
workflow table to achieve the same sort of result, rather than retrieve 
them all.

Simon


More information about the development mailing list