Problem/Motivation
Steps to reproduce
- Create a custom "basic block" titled "Test block"
- Place the block
- goto "Manage Layout" for the "Basic Block" block type.
- Add "test block" to the layout.
- Goto any page where block displays
- Get "Maximum function nesting level of " error.
Also if you place "Test Block" on the Layout override of "Test block" you will get the same error.
Proposed resolution
- For block type layout defaults don't allow placing a custom block of the current type.
- For block overrides don't allow placing the current block.
Use the new hook hook_plugin_filter_TYPE__CONSUMER_alter
to remove the blocks from the listing.
@see \layout_builder_test_plugin_filter_block__layout_builder_alter for an example of using this hook.
Remaining tasks
Write patch with tests.
User interface changes
The user will not be able to place custom blocks that would cause recursive errors.
API changes
None
Data model changes
None