Closed dsturm closed 7 months ago
Yeah I think the method will have to be split or the logic changed slightly. In the current form, that map needs to be returning as an array.
Re-reading 209 again, I'm slightly confused by the initial issue. $template
doesn't get cached. Is this happening from partials?
Unfortunately, I had not tested the issue mentioned by @djaevlen. As a quickfix, if I ditch the ->all()
in the callback, it works. But I'm not sure, whether all possible template data of a block would convert correctly.
i should have a fix in a few minutes
Re-reading 209 again, I'm slightly confused by the initial issue.
$template
doesn't get cached. Is this happening from partials?
In my issue the block (acf/button) that mainly have the template issue is using a addPartial
.
/**
* The block field group.
*
* @return array
*/
public function fields()
{
$button = Builder::make('button');
$button->addPartial(ButtonPartial::class);
return $button->build();
}
The block (acf/button) that mainly have the issue is using a addPartial.
let me know if this still happens on .10
Since #209
Block::getTemplate()
returns a JSON / string. Hence themap()
callback in https://github.com/Log1x/acf-composer/blob/a49708259ae1228f70e247d937c70f5d1e95c37c/src/Block.php#L339-L341 will fail at calling->all()
on a string.I'm currently not sure, whether we need the
->all()
in the callback.