Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested inner blocks no longer render #269

Closed
mattpfeffer opened this issue Jul 19, 2024 · 6 comments
Closed

Nested inner blocks no longer render #269

mattpfeffer opened this issue Jul 19, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@mattpfeffer
Copy link

mattpfeffer commented Jul 19, 2024

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 Log1x self-assigned this Jul 19, 2024
@Log1x Log1x added the bug Something isn't working label Jul 19, 2024
@Log1x
Copy link
Owner

Log1x commented Jul 19, 2024

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

@mattpfeffer
Copy link
Author

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
Copy link
Owner

Log1x commented Jul 19, 2024

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
Copy link
Author

👏 Looks good to me.

@Log1x Log1x closed this as completed in 4771016 Jul 19, 2024
@Log1x
Copy link
Owner

Log1x commented Jul 19, 2024

sweet, release pushed.

@mattpfeffer
Copy link
Author

Amazing, A+++ for response time 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants