Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tenancy issue when the route key is not the id #13

Open
ainesophaur opened this issue Aug 4, 2024 · 1 comment
Open

Tenancy issue when the route key is not the id #13

ainesophaur opened this issue Aug 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ainesophaur
Copy link

When building the URLs there are tenancy checks like the following

if(filament()->getTenant()){
  return redirect()->to(url(filament()->getCurrentPanel()->getId() .'/'. filament()->getTenant()->id . '/media?folder_id='.$arguments['record']['id']));
}

filament()->getCurrentPanel()->getId()

However, these calls break when the tenancy model has a route key other than id, for example, a slug key.

Navigating folders begins with the correct URL
app/example/folders but then clicking a folder attempts to redirect to app/7/media?folder_id=3 which results in a 404

off the top of my head, the solution is probably to check filament()->getTenant()->getRouteKey()

I wouldn't mind submitting a PR to solve this but I'd imagine its in more areas.

@3x1io 3x1io added the bug Something isn't working label Aug 12, 2024
@3x1io
Copy link
Member

3x1io commented Aug 12, 2024

hi @ainesophaur thanks for your report, I will try to fix it ASAP, feel free to open a PR if you have a way to fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants