2015-09-09 17:07:09 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* Post update functions for Block.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2020-03-11 20:58:38 +00:00
|
|
|
* Implements hook_removed_post_updates().
|
2015-09-09 17:07:09 +00:00
|
|
|
*/
|
2020-03-11 20:58:38 +00:00
|
|
|
function block_removed_post_updates() {
|
|
|
|
return [
|
|
|
|
'block_post_update_disable_blocks_with_missing_contexts' => '9.0.0',
|
|
|
|
'block_post_update_disabled_region_update' => '9.0.0',
|
|
|
|
'block_post_update_fix_negate_in_conditions' => '9.0.0',
|
|
|
|
];
|
2016-10-11 08:38:27 +00:00
|
|
|
}
|
Issue #1932810 by Berdir, jibran, joegraduate, joelpittet, JeroenT, RenatoG, tim.plunkett, tedbow, andypost, paulocs, hugronaphor, ankithashetty, Meenakshi_j, chr.fritsch, Beanjammin, nikitagupta, EclipseGc, dawehner, xjm, alexpott, fago, tstoeckler, catch, seanB, larowlan: Add entity bundles condition plugin for entities with bundles
2021-07-08 09:22:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Updates the node type visibility condition.
|
|
|
|
*/
|
|
|
|
function block_post_update_replace_node_type_condition() {
|
|
|
|
$config_factory = \Drupal::configFactory();
|
|
|
|
foreach ($config_factory->listAll('block.block.') as $block_config_name) {
|
|
|
|
$block = $config_factory->getEditable($block_config_name);
|
|
|
|
|
|
|
|
if ($block->get('visibility.node_type')) {
|
|
|
|
$configuration = $block->get('visibility.node_type');
|
|
|
|
$configuration['id'] = 'entity_bundle:node';
|
|
|
|
$block->set('visibility.entity_bundle:node', $configuration);
|
|
|
|
$block->clear('visibility.node_type');
|
|
|
|
$block->save(TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|