-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Hi,
I am using v2.0.126 of this package in a Symfony 5.4 project using EasyAdmin.
In my EasyAdmin crud controller I have the following field config for the EasyMediaField:
public function configureFields(string $pageName): iterable
{
return [
EasyMediaField::new('image', 'Image')
// Apply restrictions by mime-types
->setFormTypeOption(
'restrictions_uploadTypes',
[
'image/jpeg',
'image/png',
'image/gif'
]
)
// Apply restrictions to upload size in MB
->setFormTypeOption('restrictions_uploadSize', 1.0)
->setFormTypeOption('editor', true)
->setFormTypeOption('upload', true)
->setFormTypeOption('bulk_selection', true)
->setFormTypeOption('move', true)
->setFormTypeOption('rename', true)
->setFormTypeOption('metas', true)
->setFormTypeOption('delete', true)
];
}
As you can see I have added restrictions on mime-type and upload size.
However when I upload a file with a mime-type that is not allowed, or when I upload a file larger than 1MB, nothing seems to happen.
When I open the console in devtools I do get the following error messages:
At the bottom of the screenshot you can see "Uncaught ReferenceError: res is not defined", when I go to the file where the error is thrown I see the following.
There seems to be an issue with displaying the error messages to the user, specifically for these restrictions.
Could you please have a look at this?
Thanks in advance!