propperly get workflow log

This commit is contained in:
Uwe Steinmann 2022-07-26 13:39:46 +02:00
parent 6557d2edc9
commit 995f7a5bad

View File

@ -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()."<br />";
if($wkflog) {