Repeater in repeater causes data loss after reordering

68 Views Asked by At

We are using the blocks method where a repeater renders blocks. In these blocks we use repeaters again, so we have repeater in a repeater. In some cases when changing the order of repeater blocks the data of those blocks disappear which causes the data is of both blocks is empty or data merged. eg: an example:

The repeater data before saving was:

mains[2][text] = "De Subaru E-Boxer 2.5i, All-Wheel Drive, automaat, EyeSight. Vanaf"
mains[2][price] = "46.995,-"
mains[2][_group] = "disclaimer"
mains[3][c_title] = "Selecteer uw kleur"
mains[3][c_slides][0][s_title] = "Crystal Black Silica"
mains[3][c_slides][0][s_image] = "/forester/eboxer/black.jpg"
mains[3][c_slides][0][s_color] = "#100500"
mains[3][c_slides][1][s_title] = "Horizon Blue Pearl"
mains[3][c_slides][1][s_image] = "/forester/eboxer/blue.jpg"
mains[3][c_slides][1][s_color] = "#556b9f"
mains[3][_group] = "carousel"

After swapping the order of mains[2] and mains[3] the data changed to the empty groups:

mains[2][_group] = "carousel"
mains[3][_group] = "disclaimer"

Now all the field data of both blocks are empty. We experience this behaviour many times in our sites when we use repeaters in repeaters. Are we the only ones or is this a known bug? We are using the latest version 458

The first repeater used:

{repeater name="mains" groups="~/themes/outback-2019/meta/blocks.yaml" tab="Blocks"}
    {variable name="_dummy" type="text"}{/variable}
{/repeater}

The blocks yaml contains the other repeater

carousel:
    name: Carousel
    description: Car carousel
    icon: icon-picture-o
    fields:
        c_section:
            label: Carousel
            type: section
        c_title:
            label: Title
            type: text
            span: full
        c_slides:
            type: repeater
            titleFrom: title_when_collapsed
            form:
                fields:
                    s_title:
                        label: Title
                        type: text
                        span: left
                    s_image:
                        label: Image
                        type: mediafinder
                        mode: image
                    s_color:
                        label: Image
                        type: colorpicker
                        availableColors: ["#ffffff","#c8d9e3","#728258","#556b9f","#bf9f87","#8b112","#24292a","#100500"]
0

There are 0 best solutions below