DoctrineEnumBundle: Could not load type when using EasyAdminBundle
After register type as
types:
UserRoleType: AF\Bundle\UserBundle\DBAL\Types\UserRoleType
I get exception: Could not load type “UserRoleType”
why?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 33 (15 by maintainers)
@allfreelancers Here is a quick and dirty solution for you. As EasyAdmin cannot guess enum form types right now, you should set them manually. Here is how your config can look like.
I understand that it is too much manual work for each entity which uses enums. But right now it can help you to solve your problem and move on until I find a way how to integrate it into EasyAdminBundle. I took a look on those configurators, I have some idea how to tweak it, but right now don’t have enough time. So will continue fixing this issue few days later.
P.S. I also updated my bitbucket example where this config works
@allfreelancers it’s hard to read the code you paste in your comments. Luckily there’s a simple solution for that. You just need to add some ``` like this:
And to enable highlighting, use this:
Thanks!
@javiereguiluz thank you alot, I wose edit my posts