Skip to content

Bard content gone if bard button gets removed #14291

@morhi

Description

@morhi

Bug description

In a Bard field, I enabled the H3 heading option. After adding content using H3, I decided to remove the H3 button to prevent users from using it. However, any Bard field containing H3 content no longer loads — it throws an error instead:

Image

There is no way to restore the previous content or manually remove the H3, which effectively breaks every Bard field that used it, requiring a full rewrite of all affected content.

Suggested fix: The field should still load gracefully when it encounters disabled marks or styles. Two possible approaches:

  • Silently omit content that uses disabled marks/styles on load
  • Still render the content, but show a warning indicating the style is no longer permitted — and/or block saving until the issue is resolved

How to reproduce

  1. Create a Bard field and enable the H3 heading button
  2. Add content using the H3 heading
  3. Save the entry
  4. Go to the Bard field configuration and remove the H3 button
  5. Re-open the entry containing H3 content

Logs

Environment

Environment
Application Name: Statamic
Laravel Version: 12.54.1
PHP Version: 8.3.30
Composer Version: 2.9.5
Environment: local
Debug Mode: ENABLED
URL: localhost:8080
Maintenance Mode: OFF
Timezone: UTC
Locale: de

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

Drivers
Broadcasting: log
Cache: redis
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: redis

Storage
public/storage: NOT LINKED

Statamic
Addons: 2
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 6.5.0 PRO

Statamic Addons
statamic-rad-pack/meilisearch: 4.0.0
statamic/eloquent-driver: 5.4.1

Statamic Eloquent Driver
Addon Settings: file
Asset Containers: file
Assets: eloquent
Blueprints: file
Collection Trees: eloquent
Collections: file
Entries: eloquent
Fieldsets: file
Form Submissions: eloquent
Forms: file
Global Sets: file
Global Variables: eloquent
Navigation Trees: eloquent
Navigations: file
Revisions: eloquent
Sites: file
Taxonomies: file
Terms: eloquent
Tokens: eloquent

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions