Bug description
When you save a Collection configuration the default values currently get written out for any hidden fields. This means that if you have a site whose production instance has STATAMIC_REVISIONS_ENABLED set to true in .env, but since you're not Git-controlling the revisions (the default behavior), you've got that set to false on your local dev instance, then if you save the collection config from that local it will set revisions to false in the yaml. This seems wrong, because the fact that the setting is not showing (due to the .env variable) does not mean that the setting should be changed if present. This happens for all config options that have their fields currently hidden on the collection config screen, but is particularly dangerous for revisions. In such cases the revisions feature will disappear unexpectedly simply because the collection config was edited on an instance of a site where revisions was disabled in .env.
How to reproduce
- Have a collection with
revisions set to true in its yaml file on a site instance where STATAMIC_REVISIONS_ENABLED is set to true in .env.
- Change
STATAMIC_REVISIONS_ENABLED to false in .env, either in the same instance or a new clone
- Go to the collection's config page and simply save it, you don't even need to change any visible settings
- Notice that the
revisions setting in the collection's yaml is now set to false
Logs
Environment
Environment
Laravel Version: 12.69.2
PHP Version: 8.3.32
Composer Version: 2.10.2
Environment: local
Debug Mode: ENABLED
Maintenance Mode: OFF
Timezone: UTC
Locale: en
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: log
Queue: sync
Session: file
Storage
public/storage: NOT LINKED
Statamic
Addons: 7
License Key: Set
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 6.31.0 PRO
Statamic Addons
el-schneider/statamic-simple-address: 2.2.2
iagofelicio/geo-maps: 2.4.0
jacksleight/statamic-bard-texstyle: 4.2.1
mitydigital/feedamic: 3.0.13
tenseg/barnacle: 0.2.1
tenseg/cascading-entry-protection: 0.1.1
transformstudios/events: 6.1.5
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
Bug description
When you save a Collection configuration the default values currently get written out for any hidden fields. This means that if you have a site whose production instance has
STATAMIC_REVISIONS_ENABLEDset totruein.env, but since you're not Git-controlling the revisions (the default behavior), you've got that set tofalseon your local dev instance, then if you save the collection config from that local it will setrevisionstofalsein the yaml. This seems wrong, because the fact that the setting is not showing (due to the.envvariable) does not mean that the setting should be changed if present. This happens for all config options that have their fields currently hidden on the collection config screen, but is particularly dangerous for revisions. In such cases the revisions feature will disappear unexpectedly simply because the collection config was edited on an instance of a site where revisions was disabled in.env.How to reproduce
revisionsset totruein its yaml file on a site instance whereSTATAMIC_REVISIONS_ENABLEDis set totruein.env.STATAMIC_REVISIONS_ENABLEDtofalsein.env, either in the same instance or a new clonerevisionssetting in the collection's yaml is now set tofalseLogs
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response