diff --git a/src/Addons/Settings.php b/src/Addons/Settings.php index a079cb14f17..ef283122690 100644 --- a/src/Addons/Settings.php +++ b/src/Addons/Settings.php @@ -8,6 +8,7 @@ use Statamic\Events\AddonSettingsSaving; use Statamic\Facades\Antlers; use Statamic\Support\Arr; +use Statamic\View\Cascade; abstract class Settings implements Contract { @@ -96,6 +97,6 @@ protected function resolveAntlersValue($value) ->all(); } - return (string) Antlers::parse($value, ['config' => config()->all()]); + return (string) Antlers::parseUserContent($value, ['config' => Cascade::config()]); } } diff --git a/tests/Addons/SettingsTest.php b/tests/Addons/SettingsTest.php index da57fd17c8b..2621db2d521 100644 --- a/tests/Addons/SettingsTest.php +++ b/tests/Addons/SettingsTest.php @@ -93,7 +93,10 @@ public function it_gets_a_dotted_value() #[Test] public function it_sets_a_value() { - config(['test' => ['a' => 'A', 'b' => 'B']]); + config([ + 'test' => ['a' => 'A', 'b' => 'B'], + 'statamic.system.view_config_allowlist' => ['@default', 'test.a', 'test.b'], + ]); $addon = $this->makeFromPackage(); $settings = new Settings($addon, ['foo' => 'bar']); @@ -139,7 +142,10 @@ public function it_sets_a_dotted_value() #[Test] public function it_sets_all_values() { - config(['test' => ['a' => 'A', 'b' => 'B']]); + config([ + 'test' => ['a' => 'A', 'b' => 'B'], + 'statamic.system.view_config_allowlist' => ['@default', 'test.a', 'test.b'], + ]); $addon = $this->makeFromPackage(); $settings = new Settings($addon, ['foo' => 'bar']);