Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entry links in Bard field break if "Save as HTML" #11168

Open
wesort opened this issue Nov 25, 2024 · 4 comments · May be fixed by #11192
Open

Entry links in Bard field break if "Save as HTML" #11168

wesort opened this issue Nov 25, 2024 · 4 comments · May be fixed by #11192
Labels

Comments

@wesort
Copy link
Contributor

wesort commented Nov 25, 2024

Bug description

Links from a Bard to an entry work at first but later link to blank pages.

The link has broken by pointing to the entry::123... (where 123... is the ID of the entry being linked to).

How to reproduce

  • Have a Bard field with the "Save as HTML" toggle set to true. (not an issue if this toggle is false)
  • Use this Bard field to select text and create a link using the "Entry" option.
  • Visit the front-end and initially this works as expected.
  • However, on further visits to edit the page in the CP (or after a page refresh), saving that page will break the link:
    • The link is broken on the front-end as the link is pointing to entry::{id}
    • eg: <a href="entry::b1d7640f-4921-4f65-ab73-bfaa82a2a64e">
    • Broken as the "Entry" option has reverted to "URL" on the Bard link button.

Workaround

  • Don't use the "Save as HTML" option (not even sure why I was using that option on the project I experienced the bug on!)
statamic-broken-entry-link.webm

Logs

No response

Environment

Tested on [demo.statamic.com/cp](https://demo.statamic.com/cp) running `v5.39.0`

Installation

Other (please explain)

Additional details

demo.statamic.com

@duncanmcclean
Copy link
Member

Are you able to provide the full output of php please support:details?

@wesort
Copy link
Contributor Author

wesort commented Nov 25, 2024

I recreated it on demo.statamic.com to remove the complexity from the project I discovered it in.

I presume that's far easier to debug right?

@edalzell
Copy link
Contributor

I recreated it on demo.statamic.com to remove the complexity from the project I discovered it in.

I presume that's far easier to debug right?

No, that site gets refreshed regularly. Better to send in an actual site showing the issue

@wesort
Copy link
Contributor Author

wesort commented Nov 28, 2024

Fair enough.

Environment
Application Name: Redacted
Laravel Version: 10.48.25
PHP Version: 8.2.1
Composer Version: 2.8.3
Environment: dev
Debug Mode: ENABLED
URL: dev.redacted.co.uk
Maintenance Mode: OFF

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

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

Statamic
Addons: 1
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.41.0 Solo

Statamic Addons
jacksleight/statamic-bard-mutator: 3.0.3

@duncanmcclean duncanmcclean linked a pull request Nov 28, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants