mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-23 02:09:03 +02:00
The URL field of an attachment must contain a valid url.
This commit is contained in:
parent
eea81441fb
commit
f98ed076ce
1 changed files with 5 additions and 1 deletions
|
@ -45,6 +45,7 @@ use Symfony\Component\Form\Extension\Core\Type\UrlType;
|
|||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Validator\Constraints\File;
|
||||
use Symfony\Component\Validator\Constraints\Url;
|
||||
|
||||
class AttachmentFormType extends AbstractType
|
||||
{
|
||||
|
@ -74,7 +75,10 @@ class AttachmentFormType extends AbstractType
|
|||
|
||||
$builder->add('url', UrlType::class, [
|
||||
'label' => 'attachment.edit.url',
|
||||
'required' => false
|
||||
'required' => false,
|
||||
'constraints' => [
|
||||
new Url()
|
||||
]
|
||||
]);
|
||||
|
||||
$builder->add('file', FileType::class, [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue