footer elements are almost displayed
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Update all blocks reaction configuration with additional "context_id" property.
|
||||
*/
|
||||
function context_update_8001() {
|
||||
foreach (Drupal::service('context.manager')->getContexts() as $context) {
|
||||
foreach ($context->getReactions() as $reaction) {
|
||||
if ($reaction instanceof Drupal\context\Plugin\ContextReaction\Blocks) {
|
||||
foreach ($reaction->getBlocks() as $block) {
|
||||
$config = $block->getConfiguration();
|
||||
if (!isset($config['context_id'])) {
|
||||
$config['context_id'] = $context->id();
|
||||
$block->setConfiguration($config);
|
||||
$context->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update all blocks reaction configuration with additional "css_class" property.
|
||||
*/
|
||||
function context_update_8002() {
|
||||
$context_manager = \Drupal::service('context.manager');
|
||||
foreach ($context_manager->getContexts() as $context) {
|
||||
foreach ($context->getReactions() as $reaction) {
|
||||
if ($reaction instanceof \Drupal\context\Plugin\ContextReaction\Blocks) {
|
||||
foreach ($reaction->getBlocks() as $block) {
|
||||
$configuration = $block->getConfiguration();
|
||||
if (!isset($configuration['css_class'])) {
|
||||
$configuration['css_class'] = '';
|
||||
// Update the block.
|
||||
$reaction->updateBlock($configuration['uuid'], $configuration);
|
||||
$context->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user