Commit 31bc075e authored by boshtian's avatar boshtian

Merge branch '8.x-4.x' of git.drupal.org:project/context into 8.x-4.x

parents d80d46ca 8780809c
......@@ -2,5 +2,4 @@ name: Context
description: 'Set conditions and configure reactions that should be implemented when conditions pass.'
package: Context
type: module
core: 8.x
core_version_requirement: ^8 || ^9
......@@ -2,7 +2,6 @@ name: Context UI
description: 'Provides a simple UI for settings up a site structure using Context.'
package: Context
type: module
core: 8.x
core_version_requirement: ^8 || ^9
configure: entity.context.collection
......
......@@ -28,6 +28,11 @@ class RequestPathExclusion extends RequestPath implements ContainerFactoryPlugin
* {@inheritdoc}
*/
public function evaluate() {
// Allow this to pass through gracefully when blank.
$pages = mb_strtolower($this->configuration['pages']);
if (!$pages) {
return TRUE;
}
return !parent::evaluate();
}
}
......@@ -240,11 +240,16 @@ class Blocks extends ContextReactionPluginBase implements ContainerFactoryPlugin
],
];
// Merge existing attributes from block with class(es) configured in Context.
$block_content = $block->build();
$existing_attributes = isset($block_content['#attributes']) ? $block_content['#attributes'] : [];
$new_attributes['class'][] = $configuration['css_class'];
$block_build['#attributes'] = array_merge_recursive($existing_attributes, $new_attributes);
// Merge existing attributes from block with class(es) configured in Context.
if (isset($configuration['css_class']) && '' !== $configuration['css_class']) {
$new_attributes = [
'class' => [$configuration['css_class']],
];
$existing_attributes = array_merge_recursive($existing_attributes, $new_attributes);
}
$block_build['#attributes'] = $existing_attributes;
// Add additional contextual link, for editing block configuration.
$block_build['#contextual_links']['context_block'] = [
......
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