VichUploaderBundle: Cannot create mapping for YML declaration

Q A
Bug report? yes/no
Feature request? yes/no
BC Break report? yes/no
Symfony version 3.4
VichUploaderBundle version 1.8

I have entity AdminBundle\Entity\TuningPart\TuningPartImage which described in YML format.

Want to use Vich Uploader for Easyadmin

Tried use this filename Resources/config/vich_uploader/TuningPart.TuningPartImage.yml and Resources/config/vich_uploader/TuningPartImage.yml. No difference. Still receiving error Mapping not found for field "imageFile". Tried to create incorrect YML but there is no errors. Seems file hasn’t been imported.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 30 (8 by maintainers)

Most upvoted comments

Thanks, I’m found that I’m using wrong namespace in vich_uploader.yml. Fixed.

- { path: '%kernel.root_dir%/config/vich_uploader', namespace_prefix: 'AdminBundle' }

Running your command (with correct bundle namespace):

bin/console vich:mapping:debug-class “AdminBundle\TuningPart\TuningPartImage” Introspecting class AdminBundle\TuningPart\TuningPartImage: