diff --git a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_notification_include.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_notification_include.html.twig
index efc7ddfb1..9cd348333 100644
--- a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_notification_include.html.twig
+++ b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_notification_include.html.twig
@@ -1,11 +1,15 @@
-
- {{ 'workflow_'|trans }}
-
+{% if handler is not null %}
+
+ {{ 'workflow_'|trans }}
+
-
- {% include handler.template(entity_workflow) with handler.templateData(entity_workflow)|merge({
- 'description': true,
- 'breadcrumb': true,
- 'add_classes': ''
- }) %}
-
+
+ {% include handler.template(entity_workflow) with handler.templateData(entity_workflow)|merge({
+ 'description': true,
+ 'breadcrumb': true,
+ 'add_classes': ''
+ }) %}
+
+{% else %}
+ {{ 'workflow.deleted_title'|trans }}
+{% endif %}
diff --git a/src/Bundle/ChillMainBundle/Workflow/Notification/WorkflowNotificationHandler.php b/src/Bundle/ChillMainBundle/Workflow/Notification/WorkflowNotificationHandler.php
index c9ba7cf79..3d4dd9c8c 100644
--- a/src/Bundle/ChillMainBundle/Workflow/Notification/WorkflowNotificationHandler.php
+++ b/src/Bundle/ChillMainBundle/Workflow/Notification/WorkflowNotificationHandler.php
@@ -33,7 +33,7 @@ class WorkflowNotificationHandler implements NotificationHandlerInterface
return [
'entity_workflow' => $entityWorkflow,
- 'handler' => $this->entityWorkflowManager->getHandler($entityWorkflow),
+ 'handler' => null !== $entityWorkflow ? $this->entityWorkflowManager->getHandler($entityWorkflow): null,
'notificationCc' => $this->isNotificationCc($notification),
];
}
@@ -45,6 +45,10 @@ class WorkflowNotificationHandler implements NotificationHandlerInterface
if (EntityWorkflow::class === $notification->getRelatedEntityClass()) {
$relatedEntity = $this->entityWorkflowRepository->findOneBy(['id' => $notification->getRelatedEntityId()]);
+ if (null === $relatedEntity) {
+ return false;
+ }
+
if ($relatedEntity->getCurrentStepCreatedBy() !== $this->security->getUser()) {
$notificationCc = true;
}
diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml
index 51b263095..07a2bebc3 100644
--- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml
+++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml
@@ -568,6 +568,7 @@ workflow:
transition_destinee_emails_help: Le lien sécurisé sera envoyé à chaque adresse indiquée
sent_through_secured_link: Envoi par lien sécurisé
public_views_by_ip: Visualisation par adresse IP
+ deleted_title: Workflow supprimé
public_link:
expired_link_title: Lien expiré