Easyadminbundle: [BUG] Could not load type "image"

Created on 20 Dec 2017  路  5Comments  路  Source: EasyCorp/EasyAdminBundle

Trying to user image type, as in docs (https://symfony.com/doc/current/bundles/EasyAdminBundle/book/list-search-show-configuration.html#image-data-type or https://symfony.com/doc/master/bundles/EasyAdminBundle/integration/vichuploaderbundle.html#displaying-the-images-in-the-list-and-show-views)

  • { property: 'photo', type: 'image' }

but i get an error - Could not load type "image" (in vendor/symfony/form/FormRegistry.php (line 88)
How can i resolve it?
EasyAdmin version1.17.7

bug unconfirmed

All 5 comments

The solution should be in the article that you linked: https://symfony.com/doc/master/bundles/EasyAdminBundle/integration/vichuploaderbundle.html#displaying-the-images-in-the-list-and-show-views The type: image config is only for list/show, but according to the error, you are using Symfony Forms, so you are in edit/new. You should use the other types explained in that tutorial. Please tell me if that solves the issue.

Yes, i do not have an error when i use show, but i don`t see tag also (it is still input with image name).

The type: image config is only for list/show - missed that, so how can i display image in edit action? Custom templates?

There's no need to create custom templates or do anything. The bundle provides integration with VichUploaderBundle. Follow the instructions of the previous tutorial and you should be all set. You can also take a look at the code of the "Easy Admin Demo app", which contains a working example of that:

Thank you for demo, i figured it out, but i wanted something else. What if i want to show uploaded image in edit?

I'm closing this old issue as "fixed" and for the other questions, you can check the VichUploader docs or the EasyAdmin Demo example. Thanks!

Was this page helpful?
0 / 5 - 0 ratings