Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] Separate globals config and content #11585

Merged
merged 49 commits into from
Mar 24, 2025
Merged

[6.x] Separate globals config and content #11585

merged 49 commits into from
Mar 24, 2025

Conversation

duncanmcclean
Copy link
Member

@duncanmcclean duncanmcclean commented Mar 17, 2025

#8343 aimed to split up global sets and global repositories into separate repositories, to bring it inline with other features where config and content is separate (eg. forms and form submissions).

However, even after it was merged, there were still a few places where they weren't totally separate, like they should be.

This PR aims to resolve these issues, as well as making various improvements to how globals work under the hood.

Changes:

  • On single-site installs, variables are no longer stored in the global set's YAML file, they're now stored separately like they would be in a multi-site.
  • The sites a global set is localized into is now determined by the sites array in the global set's config file, rather than being determined by the existence of global variables in sites.
  • GlobalSet::in() now returns a Variables instance, even when the site doesn't have any variables.
  • The GlobalSet::addLocalization() / GlobalSet::removeLocalization() methods have been removed, in favour of calling ->save() and ->delete() on the Variables object.
  • Previously, when saving global variables in the CP, the entire global set would be saved, causing the GlobalSetCreated/GlobalSetSaved events to be dispatched.

Docs: statamic/docs#1643
Eloquent Driver PR: statamic/eloquent-driver#411

@jasonvarga jasonvarga merged commit a30c31f into master Mar 24, 2025
17 checks passed
@jasonvarga jasonvarga deleted the separate-globals branch March 24, 2025 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants