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

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

EnvironmentLaravel Version: 12.59.0PHP Version: 8.4.13Composer Version: 2.8.12Environment: localDebug Mode: ENABLEDMaintenance Mode: OFFTimezone: UTCLocale: frCacheConfig: NOT CACHEDEvents: NOT CACHEDRoutes: NOT CACHEDViews: CACHEDDriversBroadcasting: logCache: fileDatabase: mariadbLogs: stack / dailyMail: logQueue: syncSession: fileStoragepublic/storage: NOT LINKEDStatamicAddons: 3License Key: Not setSites: 1Stache Watcher: Enabled (auto)Static Caching: DisabledVersion: 6.19.0 PROStatamic Addonsjacksleight/statamic-bard-texstyle: 4.1.0statamic-rad-pack/runway: 9.4.5statamic/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