cms
cms copied to clipboard
Bard: When empty, save as empty, don't save alone `<p>` tags
Bug description
If you have a Bard field with content, then you remove the contents in Bard. It will just save empty p tags (eg. <p></p>). This makes it hard to check whether something exists.
Where you'd expect this to work:
{{ if banner_content }}
{{ banner_content }}
{{ /if }}
You actually have to do this:
{{ if banner_content && banner_content|strip_tags|is_empty == false }}
{{ banner_content }}
{{ /if }}
Ideally (in my head) it should just save as null or similar? Maybe I'm wrong?
How to reproduce
- Create Bard field
- Put content in bard field
- Take content out of Bard field via CP
- Try to check if Bard content exists (it will)
Logs
No response
Versions
Statamic 3.2.4 Pro Laravel 8.60.0 PHP 7.4.13 rias/statamic-redirect 1.4.7 statamic/migrator dev-master withcandour/aardvark-seo 2.0.15
Installation
Other (please explain)
Additional details
Migration from v2
@duncanmcclean I'm still getting this behavior (saving empty <p></p> tags). You?
Just tested this one again and it seems to be fixed.