mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fixed: fix CS + fix "my workflow" api when course or work has been delete
This commit is contained in:
parent
59da93fd75
commit
1cc61cee36
@ -46,8 +46,7 @@ class AccompanyingCourseDocumentWorkflowHandler implements EntityWorkflowHandler
|
|||||||
|
|
||||||
public function getEntityData(EntityWorkflow $entityWorkflow, array $options = []): array
|
public function getEntityData(EntityWorkflow $entityWorkflow, array $options = []): array
|
||||||
{
|
{
|
||||||
$course = $this->getRelatedEntity($entityWorkflow)
|
$course = $this->getRelatedEntity($entityWorkflow)?->getCourse();
|
||||||
->getCourse();
|
|
||||||
$persons = [];
|
$persons = [];
|
||||||
|
|
||||||
if (null !== $course) {
|
if (null !== $course) {
|
||||||
|
@ -20,7 +20,9 @@ use Symfony\Component\Security\Core\Security;
|
|||||||
|
|
||||||
class AccompanyingCourseWorkEvaluationDocumentController extends AbstractController
|
class AccompanyingCourseWorkEvaluationDocumentController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(Private Security $security) {}
|
public function __construct(private Security $security)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route(
|
* @Route(
|
||||||
@ -35,8 +37,10 @@ class AccompanyingCourseWorkEvaluationDocumentController extends AbstractControl
|
|||||||
|
|
||||||
return $this->redirectToRoute(
|
return $this->redirectToRoute(
|
||||||
$this->security->isGranted(AccompanyingPeriodWorkVoter::UPDATE, $work) ?
|
$this->security->isGranted(AccompanyingPeriodWorkVoter::UPDATE, $work) ?
|
||||||
'chill_person_accompanying_period_work_edit' : 'chill_person_accompanying_period_work_show', [
|
'chill_person_accompanying_period_work_edit' : 'chill_person_accompanying_period_work_show',
|
||||||
'id' => $work->getId()
|
[
|
||||||
]);
|
'id' => $work->getId()
|
||||||
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -47,8 +47,7 @@ class AccompanyingPeriodWorkWorkflowHandler implements EntityWorkflowHandlerInte
|
|||||||
public function getEntityData(EntityWorkflow $entityWorkflow, array $options = []): array
|
public function getEntityData(EntityWorkflow $entityWorkflow, array $options = []): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'persons' => $this->getRelatedEntity($entityWorkflow)
|
'persons' => $this->getRelatedEntity($entityWorkflow)?->getPersons() ?? [],
|
||||||
->getPersons(),
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user