Skip to content

Invalid antlers in code fields can break the control panel #14955

Description

@stuartcusackie

Bug description

I was experimenting today on a live server with my entries schema field. It's an SEO Pro field but I think this is more of a core statamic issue. If not, let me know and I will move this issue to SEO Pro.

If you place invalid antlers into the schema field you crash the control panel and the entry is no longer editable. The only way to fix things is to push the code to the repo and fix the markdown files locally.

I think this should be handled better by fields that allow antlers. I'm not sure how though.

How to reproduce

Try adding something invalid or unclosed antlers to a code field, if not then try the SEO Pro schema field. The idea was to loop my locations collection and output a 'CollectionPage' schema for my locations.

    {{ collection from="locations" site="current" status:is="published" sort="title:asc" as="locations" }}

If you do this you will should see 'Modifier 'from' not found' popup as an error on local sites (It just says 'server error' on live sites).

If you then refresh the page you will see this:
Image

The entry is no longer editable and I could only fix it by editing the entry's markdown file locally.

Logs

Statamic\Modifiers\ModifierNotFoundException
vendor\statamic\cms\src\View\Antlers\Language\Runtime\NodeProcessor.php:2276
Modifier [from] not found

Environment

Environment
Laravel Version: 13.18.1
PHP Version: 8.4.13
Composer Version: 2.8.12
Environment: local
Debug Mode: ENABLED
Maintenance Mode: OFF
Timezone: Europe/Dublin
Locale: en

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

Drivers
Broadcasting: log
Cache: file
Database: mysql
Logs: single
Mail: smtp
Queue: database
Session: file

Storage
H:\herd\mysite\public\storage: NOT LINKED

Livewire
Livewire: v4.3.3

Statamic
Addons: 6
License Key: Set
Sites: 3 (mysite.ie, mysite.co.uk, mysite.com)
Stache Watcher: Enabled
Static Caching: Disabled
Version: 6.24.0 PRO

Statamic Addons
aerni/livewire-forms: 10.3.1
eminos/statamic-tabs: 2.0.1
marcorieser/statamic-livewire: 5.3.1
spatie/statamic-responsive-images: 6.2.0
statamic/seo-pro: 7.12.3
stuartcusackie/statamic-cache-requester: 1.3.2

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions