$bid = 'myblock';
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityTypeManager()->getViewBuilder('block_content')->view($block);
$block_manager = \Drupal::service('plugin.manager.block');
/** | |
* Rebuild node access permissions. | |
* node_access_rebuild(TRUE) claims to be able to do this in batch mode but all it does is set a | |
* batch. There is no way to process the batch from within an update hook. You could do it using | |
* a separate drush command but if you only have access to run updb on your production env | |
* then you need to do all the processing from within the update hook. This gem allows complete | |
* safe permission rebuild, batched, from within a single update hook. | |
*/ | |
function mymodule_update_7001(&$sandbox) { | |
_node_access_rebuild_batch_operation($sandbox); |