sonata-project / SonataAdminBundle

The missing Symfony Admin Generator
https://docs.sonata-project.org/projects/SonataAdminBundle
MIT License
2.11k stars 1.26k forks source link

Flash message does not render the name of handled entity #3228

Closed sylzys closed 9 years ago

sylzys commented 9 years ago

First, thanks for the great job !

I use the admin bundle, and followed the docs to create admin classes for my entities, they're now displayed in the dashboard and menu, and I can create / edit them.

I'm facing a slight problem though: when I create an entity, the flash message does not render

Item "FooBar" has been successfully created.

But

Item "CouponsBundle\Entity\Company:000000007851fdde000000010739fe91" has been successfully created.

Same goes with the breadcrumb, which display for instance

Dashboard / Company List / CouponsBundle\Entity\Company:000000007934e1080000000129391fb3

I really have no idea where to dig... Thanks

sylzys commented 9 years ago

The same problem appears when I create an entity.

I got a "Company" entity, which has a OneToOne relationship with a "Contact" entity. When I create the contact, here's what appears in the form. The same appears when creating and when editing.

Cache has been cleared :/

capture d ecran 2015-09-08 a 09 51 27

rande commented 9 years ago

You need to either overwrite the toString method from the admin class or set a __toString method in your entities.

sylzys commented 9 years ago

So obvious now that you say it :'(

Thanks !

WithAlex commented 9 years ago

You need to overwrite __toString() in your entity

On Tue, Sep 8, 2015, 8:10 AM sylzys notifications@github.com wrote:

First, thanks for the great job !

I use the admin bundle, and followed the docs to create admin classes for my entities, they're now displayed in the dashboard and menu, and I can create / edit them.

I'm facing a slight problem though: when I create an entity, the flash message does not render

Item "FooBar" has been successfully created. But Item "CouponsBundle\Entity\Company:000000007851fdde000000010739fe91" has been successfully created.

Same goes with the breadcrumb, which display for instance

Dashboard / Company List / CouponsBundle\Entity\Company:000000007934e1080000000129391fb3

I really have no idea where to dig... Thanks

— Reply to this email directly or view it on GitHub https://github.com/sonata-project/SonataAdminBundle/issues/3228.