Open
Description
Hello,
I would like to use collection of VichFileType.
For this purpose, I have the following settings:
MainType.php :
->add('moreFields', CollectionType::class, array(
'label' => false,
'required' => false,
'entry_type' => FileDocumentType::class,
'prototype' => true,
'allow_add' => true,
'allow_delete' => true,
'by_reference' => false
))
FileDocumentType.php:
$builder->add('imageFile', VichFileType::class, [
'required' => false,
'allow_delete' => true
])
vich_uploader.yaml
vich_uploader:
db_driver: mongodb
mappings:
settings_image:
uri_prefix: /
upload_destination: '%kernel.project_dir%/public/uploads/images'
inject_on_load: false
delete_on_update: true
delete_on_remove: true
After updating the form, without touching the collection, I find out that the files are deleted.
How can I solve this problem?