Commit 200da2a8 authored by icurk's avatar icurk Committed by boshtian

Issue #2908234 by icurk, George Bills: Undefined index: css_class

parent 12a69aa1
......@@ -19,3 +19,25 @@ function context_update_8001() {
}
}
}
/**
* 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();
}
}
}
}
}
}
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