Skip to content

Unique set in bard field is removed on first save when "remove_empty_node" option is set to "Remove empty nodes at the start and end" #14688

@dadaxr

Description

@dadaxr

Bug description

everything is in the title ...

I have a basic bard field, with the option "remove_empty_node" set to "Remove empty nodes at the start and end". The problem does not appears when the option is set to "do not remove empty nodes" :

Image

If the bard field contains only one set (and nothing else), after the first save, the set disappears. Refreshing the page make it appearing again.

If we add any text bellow (or above) the set, the behavior is OK

a quick video :

statamic-bug-remove--empty-nodes.webm

How to reproduce

Just read what I've said above.

Logs

Environment

Environment
Laravel Version: 12.59.0
PHP Version: 8.4.13
Composer Version: 2.8.12
Environment: local
Debug Mode: ENABLED
Maintenance Mode: OFF
Timezone: UTC
Locale: fr

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

Drivers
Broadcasting: log
Cache: file
Database: mariadb
Logs: stack / daily
Mail: log
Queue: sync
Session: file

Storage
public/storage: NOT LINKED

Statamic
Addons: 3
License Key: Not set
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 6.19.0 PRO

Statamic Addons
jacksleight/statamic-bard-texstyle: 4.1.0
statamic-rad-pack/runway: 9.4.5
statamic/seo-pro: 7.8.5

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