kirby
kirby copied to clipboard
Logical inconsistency while navigating through panel users (prev/next buttons disappear on own account)
Description
When logged in as user and navigating through the panel users, you can use the arrow buttons in the upper right corner of the header. When landing on your own user account, Kirby automatically redirects from panel/users
to panel/account
and the buttons disappear.
Expected behavior
Since your own account can be between other users, I expect to stay inside panel/users
to navigate through all users back and forward.
To reproduce
- Go to accounts
- Click on random user (not yourself)
- Navigate to your user account through arrow buttons
- Page redirects, arrow buttons disappear
Your setup
Kirby Version 3.6.3.1
I think the only viable way here would be to separate the current user/account completely from other users, e.g. have two sections on the users view - first listing just the current account, second listing all other users. Between those other users one could then move prev/next without problems.
Would it be viable to use the User route also for the current account when it is accessed through the Users view? We already have access to the Account view from the menu, so I think the Users view shouldn't differentiate at all and use the User view for everyone.
If I recall correctly we had this before the fiber introduction and it led to quite a number of problems (I think it were situations like changing the language of the current user via the user not account view and similar actions that would have much more far reaching implications). But maybe @bastianallgeier remembers the details why we split this up fundamentally.
I don't have expertise and insights like you have, but one idea could be to generally handle users in an own section including the current user. For the dropdowns current user option we could then filter this section to only show the current user. But that might not solve the complications you are talking about. Thanks for having a look!
For now, I can only add a quick summary because it's still not easy to solve:
-
$user->panel()->url()
uses the/panel/accounts
URL for logged in users instead of linking to/panel/users/$userid
I would say that this is still correct. Linking to the accounts page is a more resilient way of handling it because a user might not have access to the entire users area, but still should be able to edit their own data. - The users list and profiles in the users area use
$user->panel()->url()
to get to the right user view. This is why you end up in the accounts view if you click on your own user row. The prev/next buttons use this as well. This creates the inconsistency.
Possible solutions:
- we could either make the
$user->panel()->url()
method smarter to skip accounts in the users area - we could also manually link to the user view and also change the prev/next buttons manually to avoid links to accounts.