mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
fix: exception when using hasBlockPreviews in Builder component (#17937)
* fix: `builder` clone default child components only when hasBlockPreviews is enabled * fix: php stan && code formatting * refactor: replace collection map with array_map for cloning default child components in builder * fix: clone block before retrieving default child components in builder modals
This commit is contained in:
@@ -191,7 +191,7 @@ class Builder extends Field implements CanConcealComponents, HasExtraItemActions
|
||||
]))
|
||||
->modalSubmitActionLabel(__('filament-forms::components.builder.actions.add.modal.actions.add.label'))
|
||||
->schema(function (array $arguments, Builder $component): array {
|
||||
return $component->getBlock($arguments['block'])->getDefaultChildComponents();
|
||||
return $component->getBlock($arguments['block'])->getClone()->getDefaultChildComponents();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ class Builder extends Field implements CanConcealComponents, HasExtraItemActions
|
||||
]))
|
||||
->modalSubmitActionLabel(__('filament-forms::components.builder.actions.add_between.modal.actions.add.label'))
|
||||
->schema(function (array $arguments, Builder $component): array {
|
||||
return $component->getBlock($arguments['block'])->getDefaultChildComponents();
|
||||
return $component->getBlock($arguments['block'])->getClone()->getDefaultChildComponents();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -372,7 +372,7 @@ class TextColumn extends Column implements HasEmbeddedView
|
||||
->merge($stateItemAttributes->getAttributes(), escape: false)
|
||||
->toHtml() ?>>
|
||||
<?php if ($stateItemContentAttributes) { ?>
|
||||
<span <?= $stateItemContentAttributes->toHtml() ?>>
|
||||
<span <?= $stateItemContentAttributes->toHtml() ?>>
|
||||
<?php } ?>
|
||||
|
||||
<?= $stateItemIconBeforeHtml ?>
|
||||
|
||||
Reference in New Issue
Block a user