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
Frontend: Fix broken links in /plugins when pathname has a trailing slash #64348
Conversation
@andresmgot just helped me, I was missing the trailing / in the URL (was testing with /plugins instead of /plugins/), now I can reproduce it 🤦♂️
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch 👏
const location = useLocation(); | ||
const pathName = config.appSubUrl + location.pathname; | ||
const { pathname } = useLocation(); | ||
const pathName = config.appSubUrl + (pathname.endsWith('/') ? pathname.slice(0, -1) : pathname); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although I think probably the best would be if the last item in the chain (PluginListItem) would do the validation - so whatever gets passed in it renders the correct links -, this change does the job as well. 👍
…lash (#64348) Fix broken links in /plugins when pathname has a trailing slash
This PR fixes a bug that makes all plugin links in the plugins page 404.
When on
/plugins/
route (with the trailing slash), the links get broken:Which makes every plugin link 404: