Global Set not shown unless there is a file in /content/globals
espenlg opened this issue · comments
Bug description
We're trying to create a boilerplate Statamic without any content, suited for updating several sites with different content. So we've added some lines to .gitignore to solve this.
I do however have a problem I don't understand. In /resources/blueprints/globals/
I have a settings.yaml
containing all the fields/information about this global set.
When I deploy this branch and log into /cp the global set is not shown. The reason is /content/globals/settings.yaml
does not exist. This needs to be in the .gitignore to avoid conflicts. But I can't see why it needs to be this way. The only thing missing is the title of the global set. Would it be wrong to assume /content/globals/settings.yaml
could have been created automatically if missing?
How to reproduce
- Create a global set
- Remove the
/content/globals/<handle>.yaml
file - Try to reload CP
Logs
No response
Environment
Environment
Application Name: Statamic
Laravel Version: 11.9.2
PHP Version: 8.2.16
Composer Version: 2.7.2
Environment: local
Debug Mode: ENABLED
URL: localhost
Maintenance Mode: OFF
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: statamic
Database: sqlite
Logs: stack / single
Mail: log
Queue: sync
Session: file
Statamic
Addons: 0
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.7.2 PRO
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
I solved it for now by running a bash-script when deploying the first time.
By removing the file you are basically deleting the global - so I wouldn’t expect it to be there once the stache is refreshed. There is an understandable confusion as the global and variable data is mixed when not using multi site but the file is required.
Ok, so it's about the same as deleting a collection but keep the blueprint? Then it makes sense. I've never thought about globals that way.
Yeah that’s a good analogy.