statamic / cms

The core Laravel CMS Composer package
https://statamic.com
Other
4.05k stars 530 forks source link

Bard set previews are gone starting in 4.45 #9624

Closed grantholle closed 8 months ago

grantholle commented 8 months ago

Bug description

Collapsed bard sets in < 4.45 show a preview of the data. Starting in 4.45, the set preview is empty.

4.44:

Screenshot 2024-02-29 at 2 25 50 PM

4.45:

Screenshot 2024-02-29 at 2 24 40 PM

How to reproduce

  1. Have a Bard field with sets populated.
  2. Downgrade to 4.44.0
  3. Collapse the Bard sets and see a preview of each sets' data.
  4. Upgrade to 4.45.0
  5. The sets' previews are now empty

Logs

No response

Environment

Environment
Application Name: Chengdu International School
Laravel Version: 10.45.1
PHP Version: 8.2.7
Composer Version: 2.7-dev+3427bee1f2b50fbe108c3fe81b8ba9b9fae2d960
Environment: local
Debug Mode: ENABLED
URL: cdis.test
Maintenance Mode: OFF

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

Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / daily, flare
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 5
Antlers: runtime
Stache Watcher: Enabled
Static Caching: Disabled
Version: 4.44.0 PRO

Statamic Addons
aryehraber/statamic-captcha: dev-altcha
itiden/statamic-fa-widget: 1.1.0
legrisch/statamic-graphql-responsive-images: 1.3.1
mitydigital/feedamic: 2.3.0
mitydigital/sitemapamic: 2.3.9

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

None

Additional details

No response

duncanmcclean commented 8 months ago

The Bard set previews seem to be showing as expected for me, on the latest version of Statamic.

CleanShot 2024-03-01 at 13 01 19

Are you able to provide the YAML for your Bard field in your blueprint/fieldset?

grantholle commented 8 months ago

I did a little more tinkering.

It seems that the replicator_preview key has to be present and true <= 4.45. When the key is missing, they do not appear.

When I toggled the "Preview" toggle and saved, new keys appeared in the yaml:

title: 'Base block'
fields:
  -
    handle: title
    field:
      input_type: text
      antlers: false
      display: Title
      type: text
      icon: text
      instructions: 'This is the block title.'
      listable: hidden
      instructions_position: above
      validate:
        - required
      localizable: true
      visibility: visible
      replicator_preview: true
      hide_display: false

This was the configuration prior to saving:

title: 'Base block'
fields:
  -
    handle: title
    field:
      input_type: text
      antlers: false
      display: Title
      type: text
      icon: text
      instructions: 'This is the block title.'
      listable: hidden
      instructions_position: above
      validate:
        - required
      localizable: true

While maybe not necessarily a bug, not super backwards-compatible either.