entity getdata workflow is not always defined

This commit is contained in:
Mathieu Jaumotte 2021-02-12 16:46:50 +01:00
parent 43d12a9647
commit 34a913e8e6

View File

@ -97,15 +97,17 @@ class SingleTaskTaskLifeCycleEventTimelineProvider implements TimelineProviderIn
public function getEntityTemplate($entity, $context, array $args)
{
$workflow = $this->registry->get($entity->getTask(), $entity->getData['workflow']);
$transition = $this->getTransitionByName($entity->getTransition(), $workflow);
if (isset($entity->getData()['workflow'])) {
$workflow = $this->registry->get($entity->getTask(), $entity->getData()['workflow']);
$transition = $this->getTransitionByName($entity->getTransition(), $workflow);
}
return [
'template' => 'ChillTaskBundle:Timeline:single_task_transition_task_context.html.twig',
'template_data' => [
'task' => $args['task'],
'event' => $entity,
'transition' => $transition
'transition' => $transition ?? null
]
];
}