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

Unable to find %s object with id: %s - while admin child used #6948

Closed mareckigit closed 3 years ago

mareckigit commented 3 years ago

Environment

Sonata packages

show

``` sonata-project/admin-bundle 3.93.0 ```

Subject

Unable to find %s object with id: %s.

CRUDController.php final protected function assertObjectExists(Request $request): void is executed and parent ID is used to find child by ID.

Here is used class of child and ID of parent: $this->getModelManager()->find($this->getClass(), $id);

It worked well in my previous version of Sonata Admin Bundle: 3.77

Steps to reproduce

Go to a tab of child admin with empty related objects. For example: if there is a new Thread and there is no Comments related to the Thread.

Expected results

Empty grid.

Actual results

404: Unable to find %s object with id: %s

phansys commented 3 years ago

How are you configuring the child admins? What is the URL path and the route name where you are experiencing this issue?