Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Addons/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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()]);
}
}
10 changes: 8 additions & 2 deletions tests/Addons/SettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);

Expand Down Expand Up @@ -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']);

Expand Down