EasyAdminBundle icon indicating copy to clipboard operation
EasyAdminBundle copied to clipboard

[BUG] fix(AdminUrlGenerator): unitialize before early returns

Open JacquesDurand opened this issue 3 months ago • 1 comments

Hi ! I noticed that trying to upgrade after 4.16.1 (and this commit I believe https://github.com/EasyCorp/EasyAdminBundle/commit/dc4bc4cafe2695028e70d326e1dbc635d8a90ce2 ) while still not using pretty urls (we intend to, but it is a long journey ^^), some of the generated urls break.

For instance, the url for filter modal becomes htps://localhost/admin?crudAction=renderFilters. Every other param disappears. I noticed that the previous generated url was one for the dashboard with then went trough this code bloc :

        if ([] === $routeParameters) {
            return $this->urlGenerator->generate($this->dashboardRoute);
        }

I figured the previous AdminUrlGenerator was then not uninitialized, which might leak wrong params to the next generated url.

This seems at least to fix my issue, but I might be missing something, WDYT ?

JacquesDurand avatar Nov 07 '25 14:11 JacquesDurand

Would like this one, same issue here !

yohang avatar Nov 18 '25 16:11 yohang