Closed mvdstam closed 1 year ago
Hi,
Thanks for the PR.
Are you using the latest 3.x release?
The parameter of the findLocaleBySlug
method was made nullable in this recent commit: https://github.com/codezero-be/laravel-localized-routes/commit/cd5c2b90edefb68568f21e9589df71490a5a5e58
However now I know when this issue occurs I can test it properly. So thanks x2 for the extra info :)
I'm actually on 3.1.3. Updating to 3.1.5 fixed the issue, so the commit you referred to already fixed the problem!
Hi @ivanvermeyen,
The following statement in LocalizedUrlGenerator returns either a
string
or anull
value:However, the function signature of
LocaleConfig
, doesn't take anull
:I encountered this when using the FallbackController, in combination with
redirect_to_localized_urls
when I went to an URL without locale, but with a query parameter in the URL. For example:GET http://localhost:1234/?foo=bar
This crashed the application. With the proposed fix, I get correctly redirected to
http://localhost:1234/nl?foo=bar
, wherenl
is thefallback_locale
.Cheers