Log1x / acf-composer

Compose ACF Fields, Blocks, Widgets, and Option Pages with ACF Builder on Sage 10.
https://github.com/Log1x/acf-composer
MIT License
413 stars 56 forks source link

Nested inner blocks no longer render #269

Closed mattpfeffer closed 1 month ago

mattpfeffer commented 1 month ago

Howdy, the change in #267 has introduced issues for inner blocks with some template syntaxes. I have generally been using the following syntax to declare my templates:

public $template = [
    'core/group' => [
        'metadata' => ['name' => 'Container' ],
        'layout' => ['type' => 'flex', 'flexWrap' => 'nowrap', 'justifyContent' => 'space-between', 'space' => '4', 'breakAt' => 'md'],
        'className' => 'w-full',
        'innerBlocks' => [
            ['core/button' => ['placeholder' => 'Learn more', 'className' => 'button-ciel']],
            ['core/button' => ['placeholder' => 'Learn more', 'className' => 'button-sacremento']],
            ['core/button' => ['placeholder' => 'Learn more', 'className' => 'button-sienna']],
        ]
    ]
];

which worked prior to v3.0.26. Typically handleTemplate would output:

[
  [
    "core/group",
    {
      metadata: { name: "Container" },
      layout: {
        type: "flex",
        flexWrap: "nowrap",
        justifyContent: "space-between",
        space: "4",
        breakAt: "md",
      },
      className: "w-full",
    },
    [
      ["core/button", { placeholder: "Learn more", className: "button-ciel" }],
      [
        "core/button",
        { placeholder: "Learn more", className: "button-sacremento" },
      ],
      [
        "core/button",
        { placeholder: "Learn more", className: "button-sienna" },
      ],
    ],
  ],
]

but since 3.0.26 this will output:

[
  [
    "core/group",
    {
      metadata: { name: "Container" },
      layout: {
        type: "flex",
        flexWrap: "nowrap",
        justifyContent: "space-between",
        space: "4",
        breakAt: "md",
      },
      className: "w-full",
      innerBlocks: [
        [
          "core/button",
          { placeholder: "Learn more", className: "button-ciel" },
        ],
        [
          "core/button",
          { placeholder: "Learn more", className: "button-sacremento" },
        ],
        [
          "core/button",
          { placeholder: "Learn more", className: "button-sienna" },
        ],
      ],
    },
  ]
]

This doesn't seem to work in any of my setups. I should note, I'm running under Radicle 1.4.0 and I've tested on the last two versions of ACF.

Log1x commented 1 month ago

hey sorry about that! will get this fixed for innerblocks today.

mattpfeffer commented 1 month ago

No drama, easily fixed with a roll back to 3.0.25. Just thought I'd report it in case someone else ran into the issue.

I should add, everything at the top level obviously renders fine, just the nested items come up blank in the editor.

Log1x commented 1 month ago

I already tested myself but could you give composer require log1x/acf-composer:dev-fix/269 a quick try in your project? Can cut a release right after.

mattpfeffer commented 1 month ago

👏 Looks good to me.

Log1x commented 1 month ago

sweet, release pushed.

mattpfeffer commented 1 month ago

Amazing, A+++ for response time 😉