cms icon indicating copy to clipboard operation
cms copied to clipboard

Bard inside replicator HTML set previews render raw JSON

Open jacksleight opened this issue 1 year ago • 1 comments

Bug description

If you have a bard field with a set that has an assets field, and that bard field is inside a replicator, the asset preview will render raw JSON instead of the image:

Screenshot 2024-05-31 at 17 14 30

I tried to fix it, and traced the issue to the value instanceof PreviewHtml check in ManagesPreviewText.js. For some reason the object is ending up as a plain object not a PreviewHtml object, so the check fails. But I couldn't figure where that was happening.

This does not happen with replicators/bard fields at the top level.

How to reproduce

  1. Create a replicator
  2. Add a set
  3. Create a bard field in that set
  4. Add a set
  5. Add an assets field
  6. Set an asset
  7. Collapse the set

Logs

No response

Environment

Statamic
Addons: 0
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.6.2

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

jacksleight avatar May 31 '24 16:05 jacksleight

Having the same problem. would be nice to have this fixed :)

wuifdesign avatar Aug 14 '24 11:08 wuifdesign