Merge branch '207_activity_bugfix' into 'master'

option added to distinguish between edit and new action so that modification...

See merge request Chill-Projet/chill-bundles!168
This commit is contained in:
Julien Fastré 2021-10-08 16:43:10 +00:00
commit 7ed61398ea
3 changed files with 8 additions and 5 deletions

View File

@ -27,3 +27,4 @@ Version 1.5.5
=============
- [activity] replace dropdown for selecting reasons and use chillEntity for reason rendering
- fix bug: error when trying to edit activity of which the type has been deactivated

View File

@ -174,6 +174,10 @@ class ActivityController extends AbstractController
$activityType = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityType::class)
->find($activityType_id);
if (isset($activityType) && !$activityType->isActive()) {
throw new \InvalidArgumentException('Activity type must be active');
}
$activityData = null;
if ($request->query->has('activityData')) {
$activityData = $request->query->get('activityData');

View File

@ -93,15 +93,13 @@ class ActivityType extends AbstractType
/** @var \Chill\ActivityBundle\Entity\ActivityType $activityType */
$activityType = $options['activityType'];
if (!$activityType->isActive()) {
throw new \InvalidArgumentException('Activity type must be active');
}
// TODO revoir la gestion des center au niveau du form des activité.
if ($options['center']) {
$builder->add('scope', ScopePickerType::class, [
'center' => $options['center'],
'role' => $options['role']
'role' => $options['role'],
// TODO make required again once scope and rights are fixed
'required' => false
]);
}