cms icon indicating copy to clipboard operation
cms copied to clipboard

[6.x] Addon settings' fields' default can't parse antlers

Open edalzell opened this issue 5 months ago • 3 comments

Bug description

I have a addon setting timezone:

Image

I was hoping that the default could parse antlers and the config, but the above doesn't work:

Image

How to reproduce

  1. have an addon setting field w/ a default w/ antlers:
Image

Logs


Environment

Environment
Application Name: Statamic
Laravel Version: 12.35.1
PHP Version: 8.3.26
Composer Version: 2.8.11
Environment: local
Debug Mode: ENABLED
URL: events.test
Maintenance Mode: OFF
Timezone: UTC
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: log
Queue: sync
Session: file

Storage
public/storage: NOT LINKED

Statamic
Addons: 1
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 6.0.0-alpha.14 Solo

Statamic Addons
transformstudios/events: dev-use-settings

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

edalzell avatar Oct 24 '25 17:10 edalzell

It won't parse the Antlers in the CP (because it opens a can of worms around what happens when you update the value, do we update the config/env/etc).

However, it will parse the Antlers when you attempt to get the value from the settings. Eg: $settings->get('timezone')

duncanmcclean avatar Oct 24 '25 22:10 duncanmcclean

It won't parse the Antlers in the CP (because it opens a can of worms around what happens when you update the value, do we update the config/env/etc).

If it's antlers it should be read-only

edalzell avatar Oct 24 '25 22:10 edalzell

Then, if you wanted to change the value to something else, you wouldn't be able to without manually editing the YAML file or the database.

It's handled the same way as sites - the env/config variables show in the CP, but they get evaluated everywhere else.

duncanmcclean avatar Oct 24 '25 22:10 duncanmcclean