N
N
ne-programmist2021-12-22 15:09:50
symfony
ne-programmist, 2021-12-22 15:09:50

Why does the error "object not found by the @ParamConverter" appear on an empty method with empty parameters?

Tell me, this is the situation: I was making various changes throughout the project, then suddenly I decide to go to the
/app/profile/settings route, where there are no get-parameters, and I get an error

App\Entity\Bot object not found by the @ParamConverter annotation.

I start dumping, it won't let me. I decided to completely demolish the whole method and it turned out like this:

/**
 * @Route("app/profile")
 */
class ProfileController extends AbstractController
{
    /**
     * @Route("/settings", name="profile_settings")
     */
    public function settings()
    {
        dd(1);
    }
}

and the error remains.
but the most interesting thing is that when I change the url, for example to "/settings5", everything works.
what's the catch? I do cache:clear, it doesn't help either. dev env

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tukreb, 2021-12-22
@ne-programmist

You were answered in the comments, but if you are too lazy to change, there is such a cool thing as priorities.
https://symfony.com/doc/5.4/routing.html#priority-...
Set /app/{bot}/settings/- priority=-1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question