Closed Because789 closed 2 months ago
Can you test this behaviour in a fresh browser and with a new user please?
Reason being that we actually store user preferences for certain things in the admin panel, so if you've clicked around and customised columns for example it will be stored and then re-used every time. The configuration is only respected if you have no preferences, as in a fresh user.
Oh well, that simple, yeah that was it. Same user in fresh browser didn't help. New user in fresh browser did help. For the old user in the cloud I had to trigger another sorting, and just like that the defaultColumns
were right.
But isn't that an issue? Shouldn't a new deployment trigger the deletion of this user settings, at least of those that get changed? defaultSort
isn't such an issue, but at least a change in defaultColumns
should delete this specific user setting, don't you think so?
Nice glad it's solved!
But isn't that an issue?
It's hard to actually know if the user's columns don't match default columns due to updated preferences or deployments without storing more data on them.
One thing you can do if this becomes a regular problem is to just delete user preferences from the database or using the local API in onInit or via a custom endpoint.
As a feature we've had the idea to add a button on the user account so each user can reset their own preferences if needed.
+1 for that feature.
Thanks for the help!
This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.
Link to reproduction
https://github.com/Because789/payload/tree/defaultsort-test/test/_community/collections
Environment Info
Describe the Bug
I have this collection:
In my dev environment,
defaultColumns
works, butdefaultSort
defaults to&sort=author
, although there is not a single field namedauthor
in the whole project:On my cloud instance,
defaultColumns
doesn't work anddefaultSort
defaults to&sort=-categories
:Since other collections don't show this issues, I assume the problem is the nesting in this collection with
tabs
and/orblocks
? I tried commenting out the tab with the blocks (see below), but that didn't change anything. I'm new to payload, so it's unclear to me, if there is an issue with my collection configuration or if that's a bug.Reproduction Steps
This shorter version shows the same behavior in my dev environment (didn't test it in cloud):
I added it to test/_community/collections, but didn't understand how to get it running (got a Mongo DB connection error).
Adapters and Plugins
No response