fix team edit with deactivated users (#2716)

This commit is contained in:
Kevin Papst
2021-08-11 01:23:55 +02:00
committed by GitHub
parent 305d3ba6fe
commit f6a82ba119
3 changed files with 9 additions and 0 deletions

View File

@@ -27,8 +27,13 @@ class TeamEditForm extends AbstractType
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$users = [];
/** @var Team|null $team */
$team = $options['data'] ?? null;
if ($team !== null) {
$users = $team->getUsers();
}
$builder
->add('name', TextType::class, [
@@ -48,6 +53,7 @@ class TeamEditForm extends AbstractType
'entry_type' => TeamMemberType::class,
'entry_options' => [
'label' => false,
'include_users' => $users
],
'allow_add' => true,
'by_reference' => false,