Release 2.53 (#5878)
This commit is contained in:
@@ -36,6 +36,7 @@ final class SelectWithApiDataExtension extends AbstractTypeExtension
|
||||
return;
|
||||
}
|
||||
|
||||
/** @var array{create: string, select: bool, route: string, route_params: array<string, string>, empty_route_params: array<string, string>, reload: string} $apiData */
|
||||
$apiData = $options['api_data'];
|
||||
|
||||
if (!\is_array($apiData)) {
|
||||
|
||||
@@ -12,7 +12,6 @@ namespace App\Form\Type;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Validator\Constraints\Email;
|
||||
|
||||
final class MailType extends AbstractType
|
||||
{
|
||||
@@ -20,9 +19,7 @@ final class MailType extends AbstractType
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'label' => 'email',
|
||||
'constraints' => [
|
||||
new Email(['mode' => 'html5'])
|
||||
],
|
||||
// no constraint by default, as the form or used entities should add that
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,9 +25,17 @@ final class WeekDaysType extends AbstractType
|
||||
{
|
||||
$builder->addModelTransformer(new CallbackTransformer(
|
||||
function ($weekdays): array {
|
||||
if ($weekdays === null) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return explode(',', $weekdays);
|
||||
},
|
||||
function ($weekdays): string {
|
||||
if ($weekdays === null) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return implode(',', $weekdays);
|
||||
}
|
||||
));
|
||||
|
||||
@@ -77,7 +77,7 @@ class UserCreateType extends UserEditType
|
||||
parent::configureOptions($resolver);
|
||||
|
||||
$resolver->setDefaults([
|
||||
'validation_groups' => ['UserCreate', 'Registration'],
|
||||
'validation_groups' => ['UserCreate', 'Registration', 'Default'],
|
||||
'include_roles' => false,
|
||||
'include_teams' => false,
|
||||
]);
|
||||
|
||||
@@ -31,7 +31,7 @@ class UserEditType extends AbstractType
|
||||
{
|
||||
use ColorTrait;
|
||||
|
||||
public function __construct(private SystemConfiguration $configuration)
|
||||
public function __construct(private readonly SystemConfiguration $configuration)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ class UserEditType extends AbstractType
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'validation_groups' => ['Profile'],
|
||||
'validation_groups' => ['Profile', 'Default'],
|
||||
'data_class' => User::class,
|
||||
'csrf_protection' => true,
|
||||
'csrf_field_name' => '_token',
|
||||
|
||||
Reference in New Issue
Block a user