function search_post_update_block_page

Configures default search page for instantiated blocks.

File

core/modules/search/search.post_update.php, line 14

Code

function search_post_update_block_page(&$sandbox = NULL) {
    if (!\Drupal::moduleHandler()->moduleExists('block')) {
        // Early exit when block module disabled.
        return;
    }
    \Drupal::classResolver(ConfigEntityUpdater::class)->update($sandbox, 'block', function (BlockInterface $block) {
        // Save search block to set default search page from plugin.
        return $block->getPluginId() === 'search_form_block';
    });
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.