Unverified Commit 0d2afd29 authored by alexpott's avatar alexpott
Browse files

Issue #3016829 by tim.plunkett, x11: Follow-up for intersection of #3014949 and #2968139

parent 6cbe4eac
...@@ -211,11 +211,12 @@ function layout_builder_block_content_access(EntityInterface $entity, $operation ...@@ -211,11 +211,12 @@ function layout_builder_block_content_access(EntityInterface $entity, $operation
*/ */
function layout_builder_plugin_filter_block__block_ui_alter(array &$definitions, array $extra) { function layout_builder_plugin_filter_block__block_ui_alter(array &$definitions, array $extra) {
foreach ($definitions as $id => $definition) { foreach ($definitions as $id => $definition) {
// Filter out any layout_builder definition with required contexts. // Filter out any layout_builder-provided block that has required context
if ($definition['provider'] === 'layout_builder' && !empty($definition['context'])) { // definitions.
/** @var \Drupal\Core\Plugin\Context\ContextDefinitionInterface $context */ if ($definition['provider'] === 'layout_builder' && !empty($definition['context_definitions'])) {
foreach ($definition['context'] as $context) { /** @var \Drupal\Core\Plugin\Context\ContextDefinitionInterface $context_definition */
if ($context->isRequired()) { foreach ($definition['context_definitions'] as $context_definition) {
if ($context_definition->isRequired()) {
unset($definitions[$id]); unset($definitions[$id]);
break; break;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment