Cms: Control Panel "crashes" with nested structure

Created on 3 Dec 2020  ·  3Comments  ·  Source: statamic/cms

Hey I contacted the support with this and they said I should create an issue

Bug Description

In my specific use case with Nested replicators and sets (relations) in a bard field the cp crashes when adding content to the bard field.

I checked the vue events in dev tools an there is an ifinite loop of meta-update and replicator-preview-updated
vue dev tools

How to Reproduce

My Structure:

Pages Blueprint -> rows field (replicator of row fieldset) -> colums field (replicator of colums fieldset) -> content (bard with sets. eg teaser, button, slider,etc)

So lets say I have a page with "row 1" and "row 2" both with one column ("col 1.1", "col 2.1").

If I add a relational field (entry field of teaser collection) to the bard comntent of "col1.1" everything works fine. If I add the a relational field (entry field of teaser collection) to the bard comntent of "col2.1" and hit select the CP crashes (out of memory) and nothing happens.

Extra Detail

content+resources.zip

Environment

Statamic 3.0.31 Solo
Laravel 8.16.1
PHP 7.4.9
spatie/statamic-responsive-images 1.4.0

Install method (choose one):
Fresh install from statamic/statamic

bard bug

Most helpful comment

I think I have hit this bug recently as well and was able to reproduce with a basic example on a fresh install.

Statamic 3.0.32 Solo
Laravel 8.17.2
PHP 7.4.13
No addons installed

Browser tab crashes when selecting an Entry on the second instance of a nested Bard field.

  • Add 2 Nested Bard fields to the root Bard field
  • Add Button fields to both
  • Link to existing Entry on one of them works fine (order does not seem to matter)
  • Link to existing Entry on the other one and tab crashes

Basic Blueprint

title: Pages
sections:
  main:
    display: Main
    fields:
      -
        handle: title
        field:
          type: text
          required: true
          validate:
            - required
      -
        handle: bard
        field:
          always_show_set_button: false
          sets:
            nested_bard:
              display: 'Nested Bard'
              fields:
                -
                  handle: bard
                  field:
                    always_show_set_button: false
                    buttons:
                      - h2
                      - h3
                      - bold
                      - italic
                      - unorderedlist
                      - orderedlist
                      - removeformat
                      - quote
                      - anchor
                      - image
                      - table
                    save_html: false
                    toolbar_mode: fixed
                    link_noopener: false
                    link_noreferrer: false
                    target_blank: false
                    reading_time: false
                    fullscreen: true
                    allow_source: true
                    display: Bard
                    type: bard
                    icon: bard
                    listable: hidden
                    sets:
                      button:
                        display: Button
                        fields:
                          -
                            handle: entries
                            field:
                              mode: default
                              collections:
                                - pages
                              display: Entries
                              type: entries
                              icon: entries
                              listable: hidden
          buttons:
            - h2
            - h3
            - bold
            - italic
            - unorderedlist
            - orderedlist
            - removeformat
            - quote
            - anchor
            - image
            - table
          save_html: false
          toolbar_mode: fixed
          link_noopener: false
          link_noreferrer: false
          target_blank: false
          reading_time: false
          fullscreen: true
          allow_source: true
          display: Bard
          type: bard
          icon: bard
          listable: hidden
  sidebar:
    display: Sidebar
    fields:
      -
        handle: slug
        field:
          type: slug
          required: true
          localizable: true
          validate:
            - required
      -
        handle: parent
        field:
          type: entries
          collections:
            - pages
          max_items: 1
          listable: false
          localizable: true

Screenshot 2020-12-04 at 10 11 36

All 3 comments

I think I have hit this bug recently as well and was able to reproduce with a basic example on a fresh install.

Statamic 3.0.32 Solo
Laravel 8.17.2
PHP 7.4.13
No addons installed

Browser tab crashes when selecting an Entry on the second instance of a nested Bard field.

  • Add 2 Nested Bard fields to the root Bard field
  • Add Button fields to both
  • Link to existing Entry on one of them works fine (order does not seem to matter)
  • Link to existing Entry on the other one and tab crashes

Basic Blueprint

title: Pages
sections:
  main:
    display: Main
    fields:
      -
        handle: title
        field:
          type: text
          required: true
          validate:
            - required
      -
        handle: bard
        field:
          always_show_set_button: false
          sets:
            nested_bard:
              display: 'Nested Bard'
              fields:
                -
                  handle: bard
                  field:
                    always_show_set_button: false
                    buttons:
                      - h2
                      - h3
                      - bold
                      - italic
                      - unorderedlist
                      - orderedlist
                      - removeformat
                      - quote
                      - anchor
                      - image
                      - table
                    save_html: false
                    toolbar_mode: fixed
                    link_noopener: false
                    link_noreferrer: false
                    target_blank: false
                    reading_time: false
                    fullscreen: true
                    allow_source: true
                    display: Bard
                    type: bard
                    icon: bard
                    listable: hidden
                    sets:
                      button:
                        display: Button
                        fields:
                          -
                            handle: entries
                            field:
                              mode: default
                              collections:
                                - pages
                              display: Entries
                              type: entries
                              icon: entries
                              listable: hidden
          buttons:
            - h2
            - h3
            - bold
            - italic
            - unorderedlist
            - orderedlist
            - removeformat
            - quote
            - anchor
            - image
            - table
          save_html: false
          toolbar_mode: fixed
          link_noopener: false
          link_noreferrer: false
          target_blank: false
          reading_time: false
          fullscreen: true
          allow_source: true
          display: Bard
          type: bard
          icon: bard
          listable: hidden
  sidebar:
    display: Sidebar
    fields:
      -
        handle: slug
        field:
          type: slug
          required: true
          localizable: true
          validate:
            - required
      -
        handle: parent
        field:
          type: entries
          collections:
            - pages
          max_items: 1
          listable: false
          localizable: true

Screenshot 2020-12-04 at 10 11 36

I seem to encounter a similiar bug with a Terms-field instead of an Entry-field and a Replicator-field instead of the wrapping Bard-field.

Situation

For my portfolio I use a Replicator containing a fieldset with a Bard field containing a fieldset with a Terms field.

image

Bug-Description

  1. Adding first Replicator-element with Bard-field ✅
  2. InsideBard-field adding fieldset withTerms-field ✅
  3. Selecting Terms and closing terms-window ✅
  4. Adding second Replicator-element with Bard-field ✅
  5. InsideBard-field adding fieldset withTerms-field ✅
  6. Selecting Terms and closing terms-window ❌

The following shows my behaviour. At the end the crash happens... (but you can't really see it it in the GIF. :( )

Screen Recording 2020-12-09 at 09 12 36

I got my portfolio done by editing the .md-file. But I would love to use the backend again. :)

We have a similar case. A nested bard with the option of a page (collection) and event (collection) selection. The moment I make a selection for the page the CP crashes.

  • blueprint: pages/default.yaml

    • imported fieldset: content.yaml. This contains the body field which is the bard and 30 sets.



      • imported fieldset: two_bard.yaml: with a nested bard with two columns with 5 additional sets



Noteworthy for our case is though that it only crashes on editing a page with already a lot of content present. When I create a new page and just add this two_bard set, it does work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

austenc picture austenc  ·  3Comments

riasvdv picture riasvdv  ·  4Comments

aerni picture aerni  ·  3Comments

ReneWeCode picture ReneWeCode  ·  3Comments

filipac picture filipac  ·  4Comments