filament-fabricator icon indicating copy to clipboard operation
filament-fabricator copied to clipboard

Infinite loop when Builder in used inside Builder

Open enact-on opened this issue 1 year ago • 1 comments

Hello, I've been playing around with this awesome package and it does a wonderful job. I are trying to use this to act like a "Page builder" for simple frontend website.

I want to create column options for the page block, and tried this simple approach, basically to provide PageBuilder itself in the schema. However it goes to infinite loop and throws this error.

Xdebug has detected a possible infinite loop, and aborted your script with a stack depth of '512' frames

Anyway to get this issue resolved ? Or maybe another approach to manage the column option.

Here's the code

public static function getBlockSchema(): Block
{
    return Block::make('two-column')
		->columns(2)
        ->schema([
            PageBuilder::make('block1')->label(__('filament-fabricator::page-resource.labels.blocks')),
            PageBuilder::make('block2')->label(__('filament-fabricator::page-resource.labels.blocks')),
        ]);
}

enact-on avatar May 09 '24 17:05 enact-on

You'd need to manually define the blocks for the nested page builder.

See for an example https://github.com/Z3d0X/filament-fabricator/discussions/36#discussioncomment-4847370

Z3d0X avatar May 12 '24 12:05 Z3d0X