Skip to content

Asset links break when filename contains parentheses #14361

@gn-bmiddendorp

Description

@gn-bmiddendorp

Bug description

When inserting an asset link via the Bard fieldtype and the selected asset’s filename contains parentheses (e.g. document (2).pdf), the generated front-end link is incorrect. Instead of a valid URL, the output becomes a Statamic reference

How to reproduce

  1. Edit a page/block that contains a Bard Editor
  2. Insert a link and choose Asset.
  3. Select or upload an asset with parentheses in the filename, e.g. document (2).pdf.
  4. Save and publish.
  5. Visit the page on the front-end and click (or inspect) the generated link.

Logs

Environment

Environment
Application Name: DKG Keuzekompas
Laravel Version: 12.53.0
PHP Version: 8.4.6
Composer Version: 2.8.8
Environment: dev
Debug Mode: ENABLED
URL: dkg-keuzekompas-backend.e-container.nl
Maintenance Mode: OFF
Timezone: UTC
Locale: nl

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

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

Storage
public/storage: NOT LINKED

Sentry
Enabled: MISSING DSN
Environment: dev
Laravel SDK Version: 4.15.1
PHP SDK Version: 4.14.2
Release: NOT SET
Sample Rate Errors: 100%
Sample Rate Performance Monitoring: NOT SET
Sample Rate Profiling: NOT SET
Send Default PII: DISABLED

Statamic
Addons: 4
Sites: 1
Stache Watcher: Disabled (auto)
Static Caching: Disabled
Version: 5.73.15 PRO

Statamic Addons
mitydigital/statamic-two-factor: 2.7.2
ryanmitchell/statamic-translation-manager: 2.2.1
statamic-rad-pack/runway: 8.5.2
statamic/eloquent-driver: 4.30.0

Statamic Eloquent Driver
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: file
Navigation Trees: eloquent
Navigations: file
Revisions: eloquent
Sites: file
Taxonomies: file
Terms: file
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