Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295131

Don't allow placing a Custom Block in the layout override for itself or a default layout

$
0
0

Problem/Motivation

Steps to reproduce

  1. Create a custom "basic block" titled "Test block"
  2. Place the block
  3. goto "Manage Layout" for the "Basic Block" block type.
  4. Add "test block" to the layout.
  5. Goto any page where block displays
  6. 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

  1. For block type layout defaults don't allow placing a custom block of the current type.
  2. 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


Viewing all articles
Browse latest Browse all 295131

Trending Articles