Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3924

Symfony 4 + Sonata Admin - No metadata found for property in inherited property

$
0
0

I've got an error for some time now when I try to add filters to an Admin. There are two entities: Client and Order.

In the OrderAdmin file, the following filters work:

$datagridMapper
    ->add('id')
    ->add('client.email')
    ->add('client.id')
;

But if I add this line ->add('client.name') it triggers this error:

No metadata found for property `App\Entity\Order::$client.name. Please make sure your Doctrine mapping is properly configured.

The Client entity is inherited by two others entities. Both of them contain the property name. While the id and email are both present in the parent entity. I'm guessing this is why the error appears:

* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="type", type="string")
* @ORM\DiscriminatorMap({"user_1" = "one", "user_2" = "two"})

This used to work fine on previous versions. Any idea of how to solve the problem? (Transferring the name property to the parent class isn't really a solution for me).


Viewing all articles
Browse latest Browse all 3924

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>