Open robdekort opened 2 months ago
Do you have any preferences set?
Nope! Can't reproduce it then?
Yeah, it seems to be working fine for me. I don't have any preferences set.
Crickey, you're making me question my sanity. Ok I just did a fresh install: statamic new test
.
I've managed to figure out why this is happening...
The Field::isVisibleOnListing()
method checks if a field is display-able on the listing table, by taking the listable
config option into account (which defaults to "Hidden by default"):
It checks whether or not listable
is null. When it is, it checks the handles, and returns true
for fields like title
and slug
. This is so you always see some columns on a new collection, before you've gone in and customised the blueprint.
This worked fine in Statamic 3 and 4. However, in Statamic 5 we introduced some changes so that default values for fields aren't saved in blueprint YAML files, to try and tidy them up a little.
Because of these changes, it means that if you have listable
to "Hidden by default", $this->get('listable')
will come back as null, making it think it should show those "default columns".
I'm not sure on the best approach to fix this one. 🤔
Good find though!
Bug description
Slugs are shown in collection tables even with listable set to
Hidden by default
How to reproduce
Create a collection Set slugs to
Hidden by default
View collection table See slugsLogs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response