Skip to content

[6.x] Allow addons to extend Replicator/Bard set configuration - #15422

Draft
eminos wants to merge 1 commit into
statamic:6.xfrom
eminos:feature/extend-set-config
Draft

[6.x] Allow addons to extend Replicator/Bard set configuration#15422
eminos wants to merge 1 commit into
statamic:6.xfrom
eminos:feature/extend-set-config

Conversation

@eminos

@eminos eminos commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Addons can append fieldtype configuration, but cannot add fields to the Edit Set stack in Replicator or Bard. Custom set metadata added in YAML is also discarded when a field is saved through the blueprint editor.

This adds Sets::appendSetConfigField() and Sets::appendSetConfigFields() for native fields in that stack. Values are stored alongside the set's existing configuration and pass through native preprocessing, validation, metadata loading, and processing. Nested fields are supported. Unregistered custom metadata survives a round trip, including when its addon is temporarily disabled. Reserved native keys cannot be registered or overwritten through the extra configuration values.

use Statamic\Fieldtypes\Sets;

Sets::appendSetConfigFields([
    'addon_note' => [
        'type' => 'textarea',
        'display' => 'Editorial guidance',
    ],
]);

Addresses statamic/ideas#1484. Documentation tracking: statamic/docs#1983. This is configuration on reusable set definitions, separate from content-instance settings discussed in #11720. The core change contains no addon-specific fields.

Validation:

  • 74 PHP tests passed, including new Replicator/Bard field-editor endpoint tests, nested validation, defaults, metadata preservation, rename/reorder/duplicate, and existing Sets/FieldTransformer/Fieldtype coverage.
  • Four Vue tests passed for Cancel, Confirm, isolated defaults, and ordinary blueprint sections.
  • Control Panel production builds passed for current 6.x and a patch applied to v6.31.0.
  • Browser-tested the patch in a local 6.31.0 site with an addon's group containing textarea, list, and YAML fields. Existing guidance loaded, Cancel discarded changes, and Confirm followed by field/fieldset Save persisted the edit through a full reload. The site's original test data was restored afterward.

Draft for discussion of the API and persistence scope, and for further local hands-on testing. Compiled assets are omitted per the contribution guide.

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.

1 participant