diff --git a/src/Stache/Stores/GlobalsStore.php b/src/Stache/Stores/GlobalsStore.php index aafdf2f01b..205082b544 100644 --- a/src/Stache/Stores/GlobalsStore.php +++ b/src/Stache/Stores/GlobalsStore.php @@ -4,6 +4,7 @@ use Statamic\Facades\GlobalSet; use Statamic\Facades\Path; +use Statamic\Facades\Stache; use Statamic\Facades\YAML; use Statamic\Support\Arr; use Symfony\Component\Finder\SplFileInfo; @@ -15,6 +16,15 @@ public function key() return 'globals'; } + public function paths() + { + if ($this->directory !== Stache::store('global-variables')->directory()) { + throw new \Exception('The [globals] and [global-variables] Stache stores must share the same directory.'); + } + + return parent::paths(); + } + public function getItemFilter(SplFileInfo $file) { // The global sets themselves should only exist in the root