diff --git a/views/bootstrap/class.TriggerWorkflow.php b/views/bootstrap/class.TriggerWorkflow.php index 86f14626c..d700a11c0 100644 --- a/views/bootstrap/class.TriggerWorkflow.php +++ b/views/bootstrap/class.TriggerWorkflow.php @@ -66,8 +66,16 @@ $(document).ready(function() { $action = $transition->getAction(); $currentstate = $latestContent->getWorkflowState(); $wkflogs = $latestContent->getWorkflowLog(); - $wkflog = array_shift($wkflogs); - $workflow = $latestContent->getWorkflow(); + /* Check if latest content is still in workflow, which should be + * always the case, otherwise this code would be executed. + * In that case the returned log is just a list of entries for the + * current workflow. If the document was not in a workflow, then the + * log entries for all workflows of this content will be returned + */ + if($workflow = $latestContent->getWorkflow()) + $wkflog = $wkflogs; + else + $wkflog = array_shift($wkflogs); $msg = "The document is currently in state: ".$currentstate->getName()."
"; if($wkflog) {