diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/block/block/AggregatorCategoryBlock.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/block/block/AggregatorCategoryBlock.php index aa1036c..4c2df27 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/block/block/AggregatorCategoryBlock.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/block/block/AggregatorCategoryBlock.php @@ -62,9 +62,9 @@ public function blockSubmit($form, &$form_state) { } /** - * Implements \Drupal\block\BlockInterface::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { $id = $this->getPluginId(); if ($category = db_query('SELECT cid, title, block FROM {aggregator_category} WHERE cid = :cid', array(':cid' => $id))->fetchObject()) { $result = db_query_range('SELECT i.* FROM {aggregator_category_item} ci LEFT JOIN {aggregator_item} i ON ci.iid = i.iid WHERE ci.cid = :cid ORDER BY i.timestamp DESC, i.iid DESC', 0, $this->configuration['block_count'], array(':cid' => $category->cid)); diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/block/block/AggregatorFeedBlock.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/block/block/AggregatorFeedBlock.php index 58391d7..e902eb5 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/block/block/AggregatorFeedBlock.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/block/block/AggregatorFeedBlock.php @@ -62,9 +62,9 @@ public function blockSubmit($form, &$form_state) { } /** - * Implements \Drupal\block\BlockInterface::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { // Plugin IDs look something like this: aggregator_feed_block:1. list(, $id) = explode(':', $this->getPluginId()); if ($feed = db_query('SELECT fid, title, block FROM {aggregator_feed} WHERE block <> 0 AND fid = :fid', array(':fid' => $id))->fetchObject()) { diff --git a/core/modules/block/block.module b/core/modules/block/block.module index b1a5f52..31ef8db 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -515,7 +515,7 @@ function _block_get_renderable_block($element) { $block = $element['#block']; // Don't bother to build blocks that aren't accessible. if ($element['#access'] = $block->access()) { - $build = block_build($block); + $build = $block->build(); if ($build) { if (isset($build['#title'])) { $element['#title'] = $build['#title']; @@ -531,34 +531,6 @@ function _block_get_renderable_block($element) { } /** - * Allows blocks to be altered after they are built. - * - * @param \Drupal\block\BlockInterface $block - * The block instance. - * - * @return array $build - * A renderable array of data. - * - #title: The default localized title of the block. - * - * @todo Move the alter invocation into a plugin method. - * @todo Add specific examples of $id and $name below. - */ -function block_build($block) { - // Allow modules to modify the block before it is viewed, via either - // hook_block_view_alter(), hook_block_view_ID_alter(), or - // hook_block_view_NAME_alter(). - $id = str_replace(':', '__', $block->getPluginId()); - - $config = $block->getConfig(); - $config_id = explode('.', $config['config_id']); - $name = array_pop($config_id); - - $build = $block->build(); - drupal_alter(array('block_view', "block_view_$id", "block_view_$name"), $build, $block); - return $build; -} - -/** * Implements hook_cache_flush(). */ function block_cache_flush() { diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/block/block/CustomBlock.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/block/block/CustomBlock.php index f4d3375..29a7af9 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/block/block/CustomBlock.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/block/block/CustomBlock.php @@ -90,9 +90,9 @@ public function blockSubmit($form, &$form_state) { } /** - * Implements \Drupal\block\BlockInterface::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { // Populate the block with the user-defined block body. return array( '#theme' => 'custom_block_block', diff --git a/core/modules/block/lib/Drupal/block/BlockBase.php b/core/modules/block/lib/Drupal/block/BlockBase.php index d1f0e40..5d9e1e8 100644 --- a/core/modules/block/lib/Drupal/block/BlockBase.php +++ b/core/modules/block/lib/Drupal/block/BlockBase.php @@ -21,6 +21,10 @@ /** * Implements \Drupal\block\BlockInterface::settings(). * + * Most block plugins should not override this method. To add additional + * settings or change the default values for setting, override + * BlockBase::blockSettings(). + * * @see \Drupal\block\BlockBase::blockSettings() */ public function settings() { @@ -36,7 +40,7 @@ public function settings() { /** * Returns plugin-specific settings for the block. * - * Block plugins only need to implement this method if they override the + * Block plugins only need to override this method if they override the * defaults provided in BlockBase::settings(). * * @return array @@ -211,7 +215,8 @@ public function access() { * * Creates a generic configuration form for all block types. Individual * block plugins can add elements to this form by overriding - * BlockBase::blockForm(). + * BlockBase::blockForm(). Most block plugins should not override this + * method unless they need to alter the generic form elements. * * @see \Drupal\block\BlockBase::blockForm() */ @@ -452,6 +457,9 @@ public function blockForm($form, &$form_state) { /** * Implements \Drupal\block\BlockInterface::validate(). * + * Most block plugins should not override this method. To add validation + * for a specific block type, override BlockBase::blockValdiate(). + * * @todo Add inline documentation to this method. * * @see \Drupal\block\BlockBase::blockValidate() @@ -505,6 +513,9 @@ public function blockValidate($form, &$form_state) {} /** * Implements \Drupal\block\BlockInterface::submit(). * + * Most block plugins should not override this method. To add submission + * handling for a specific block type, override BlockBase::blockSubmit(). + * * @todo Add inline documentation to this method. * * @see \Drupal\block\BlockBase::blockSubmit() @@ -564,4 +575,46 @@ public function submit($form, &$form_state) { */ public function blockSubmit($form, &$form_state) {} + /** + * Implements \Drupal\block\BlockInterface::build(). + * + * Allows blocks to be altered after they are built. + * + * Most block plugins should not override this method. To define how a + * particular block is rendered, implement the abstract method + * BlockBase::blockBuild(). + * + * @return array $build + * A renderable array of data. + * - #title: The default localized title of the block. + * + * @todo Add specific examples of $id and $name below. + * + * @see \Drupal\block\BlockBase::blockBuild() + */ + public function build() { + // Allow modules to modify the block before it is viewed, via either + // hook_block_view_alter(), hook_block_view_ID_alter(), or + // hook_block_view_NAME_alter(). + $id = str_replace(':', '__', $this->getPluginId()); + + $config = $this->getConfig(); + $config_id = explode('.', $config['config_id']); + $name = array_pop($config_id); + + $build = $this->blockBuild(); + drupal_alter(array('block_view', "block_view_$id", "block_view_$name"), $build, $this); + return $build; + } + + /** + * Builds the renderable array for a specific block type. + * + * @return array + * A renderable array representing the output of the block. + * + * @see \Drupal\block\BlockBase::build() + */ + abstract public function blockBuild(); + } diff --git a/core/modules/block/tests/lib/Drupal/block_test/Plugin/block/block/TestCacheBlock.php b/core/modules/block/tests/lib/Drupal/block_test/Plugin/block/block/TestCacheBlock.php index 57a7ac8..aeb7709 100644 --- a/core/modules/block/tests/lib/Drupal/block_test/Plugin/block/block/TestCacheBlock.php +++ b/core/modules/block/tests/lib/Drupal/block_test/Plugin/block/block/TestCacheBlock.php @@ -34,9 +34,9 @@ public function blockSettings() { } /** - * Implements \Drupal\block\BlockInterface::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { return array( '#children' => state()->get('block_test.content'), ); diff --git a/core/modules/book/lib/Drupal/book/Plugin/block/block/BookNavigationBlock.php b/core/modules/book/lib/Drupal/book/Plugin/block/block/BookNavigationBlock.php index edaae57..c1823e1 100644 --- a/core/modules/book/lib/Drupal/book/Plugin/block/block/BookNavigationBlock.php +++ b/core/modules/book/lib/Drupal/book/Plugin/block/block/BookNavigationBlock.php @@ -59,9 +59,9 @@ public function blockSubmit($form, &$form_state) { } /** - * Implements \Drupal\block\BlockInterface::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { $current_bid = 0; if ($node = menu_get_object()) { $current_bid = empty($node->book['bid']) ? 0 : $node->book['bid']; diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/block/block/RecentCommentsBlock.php b/core/modules/comment/lib/Drupal/comment/Plugin/block/block/RecentCommentsBlock.php index e9ce19b..d5c3d7b 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/block/block/RecentCommentsBlock.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/block/block/RecentCommentsBlock.php @@ -59,9 +59,9 @@ public function blockSubmit($form, &$form_state) { } /** - * Implements \Drupal\block\BlockInterface::build(); + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { return array( '#theme' => 'comment_block', '#number' => $this->configuration['block_count'], diff --git a/core/modules/forum/lib/Drupal/forum/Plugin/block/block/ActiveTopicsBlock.php b/core/modules/forum/lib/Drupal/forum/Plugin/block/block/ActiveTopicsBlock.php index 9b8cda5..afa7117 100644 --- a/core/modules/forum/lib/Drupal/forum/Plugin/block/block/ActiveTopicsBlock.php +++ b/core/modules/forum/lib/Drupal/forum/Plugin/block/block/ActiveTopicsBlock.php @@ -22,9 +22,9 @@ class ActiveTopicsBlock extends ForumBlockBase { /** - * Implements \Drupal\block\BlockInterface::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { $query = db_select('forum_index', 'f') ->fields('f') ->addTag('node_access') diff --git a/core/modules/forum/lib/Drupal/forum/Plugin/block/block/NewTopicsBlock.php b/core/modules/forum/lib/Drupal/forum/Plugin/block/block/NewTopicsBlock.php index 1b5d9b4..083469c 100644 --- a/core/modules/forum/lib/Drupal/forum/Plugin/block/block/NewTopicsBlock.php +++ b/core/modules/forum/lib/Drupal/forum/Plugin/block/block/NewTopicsBlock.php @@ -22,9 +22,9 @@ class NewTopicsBlock extends ForumBlockBase { /** - * Implements \Drupal\block\BlockInterface::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { $query = db_select('forum_index', 'f') ->fields('f') ->addTag('node_access') diff --git a/core/modules/language/lib/Drupal/language/Plugin/block/block/LanguageBlock.php b/core/modules/language/lib/Drupal/language/Plugin/block/block/LanguageBlock.php index f303211..74fb83a 100644 --- a/core/modules/language/lib/Drupal/language/Plugin/block/block/LanguageBlock.php +++ b/core/modules/language/lib/Drupal/language/Plugin/block/block/LanguageBlock.php @@ -31,9 +31,9 @@ function blockAccess() { } /** - * Implements \Drupal\block\BlockInterface::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - function build() { + public function blockBuild() { $path = drupal_is_front_page() ? '' : current_path(); list($plugin_id, $type) = explode(':', $this->getPluginId()); $links = language_negotiation_get_switch_links($type, $path); diff --git a/core/modules/menu/lib/Drupal/menu/Plugin/block/block/MenuBlock.php b/core/modules/menu/lib/Drupal/menu/Plugin/block/block/MenuBlock.php index cff3abd..7134dc50 100644 --- a/core/modules/menu/lib/Drupal/menu/Plugin/block/block/MenuBlock.php +++ b/core/modules/menu/lib/Drupal/menu/Plugin/block/block/MenuBlock.php @@ -24,9 +24,9 @@ class MenuBlock extends SystemMenuBlock { /** - * Overrides \Drupal\system\Plugin\block\block\SystemMenuBlock::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { list($plugin, $menu) = explode(':', $this->getPluginId()); return menu_tree($menu); } diff --git a/core/modules/node/lib/Drupal/node/Plugin/block/block/RecentContentBlock.php b/core/modules/node/lib/Drupal/node/Plugin/block/block/RecentContentBlock.php index f7003b4..cb05c5c 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/block/block/RecentContentBlock.php +++ b/core/modules/node/lib/Drupal/node/Plugin/block/block/RecentContentBlock.php @@ -59,9 +59,9 @@ public function blockSubmit($form, &$form_state) { } /** - * Implements \Drupal\block\BlockInterface::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { if ($nodes = node_get_recent($this->configuration['block_count'])) { return array( '#theme' => 'node_recent_block', diff --git a/core/modules/node/lib/Drupal/node/Plugin/block/block/SyndicateBlock.php b/core/modules/node/lib/Drupal/node/Plugin/block/block/SyndicateBlock.php index 460045a..5c83e27 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/block/block/SyndicateBlock.php +++ b/core/modules/node/lib/Drupal/node/Plugin/block/block/SyndicateBlock.php @@ -39,9 +39,9 @@ public function blockAccess() { } /** - * Implements \Drupal\block\BlockInterface::build(); + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { return array( '#theme' => 'feed_icon', '#url' => 'rss.xml', diff --git a/core/modules/poll/lib/Drupal/poll/Plugin/block/block/PollRecentBlock.php b/core/modules/poll/lib/Drupal/poll/Plugin/block/block/PollRecentBlock.php index 67c13ab..b597741 100644 --- a/core/modules/poll/lib/Drupal/poll/Plugin/block/block/PollRecentBlock.php +++ b/core/modules/poll/lib/Drupal/poll/Plugin/block/block/PollRecentBlock.php @@ -65,9 +65,9 @@ public function blockAccess() { } /** - * Implements \Drupal\block\BlockInterface::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { $poll = node_load($this->record); if ($poll->nid) { $poll = poll_block_latest_poll_view($poll); diff --git a/core/modules/search/lib/Drupal/search/Plugin/block/block/SearchBlock.php b/core/modules/search/lib/Drupal/search/Plugin/block/block/SearchBlock.php index a6fbb04..d9bdb7c 100644 --- a/core/modules/search/lib/Drupal/search/Plugin/block/block/SearchBlock.php +++ b/core/modules/search/lib/Drupal/search/Plugin/block/block/SearchBlock.php @@ -30,9 +30,9 @@ public function blockAccess() { } /** - * Implements \Drupal\block\BlockInterface::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { return array(drupal_get_form('search_block_form')); } diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Plugin/block/block/ShortcutsBlock.php b/core/modules/shortcut/lib/Drupal/shortcut/Plugin/block/block/ShortcutsBlock.php index 7638a29..d236a19 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Plugin/block/block/ShortcutsBlock.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Plugin/block/block/ShortcutsBlock.php @@ -23,9 +23,9 @@ class ShortcutsBlock extends BlockBase { /** - * Implements \Drupal\block\BlockInterface::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { return array( shortcut_renderable_links(shortcut_current_displayed_set()), ); diff --git a/core/modules/statistics/lib/Drupal/statistics/Plugin/block/block/StatisticsPopularBlock.php b/core/modules/statistics/lib/Drupal/statistics/Plugin/block/block/StatisticsPopularBlock.php index cb82dcc..8c9fdf6 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Plugin/block/block/StatisticsPopularBlock.php +++ b/core/modules/statistics/lib/Drupal/statistics/Plugin/block/block/StatisticsPopularBlock.php @@ -116,9 +116,9 @@ public function blockSubmit($form, &$form_state) { } /** - * Implements \Drupal\block\BlockInterface::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { $content = array(); if ($this->day_list) { diff --git a/core/modules/system/lib/Drupal/system/Plugin/block/block/SystemHelpBlock.php b/core/modules/system/lib/Drupal/system/Plugin/block/block/SystemHelpBlock.php index ac50042..6026f83 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/block/block/SystemHelpBlock.php +++ b/core/modules/system/lib/Drupal/system/Plugin/block/block/SystemHelpBlock.php @@ -38,9 +38,9 @@ public function blockAccess() { } /** - * Implements \Drupal\block\BlockInterface::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { return array( '#children' => $this->help, ); diff --git a/core/modules/system/lib/Drupal/system/Plugin/block/block/SystemMainBlock.php b/core/modules/system/lib/Drupal/system/Plugin/block/block/SystemMainBlock.php index 21e4268..8b40092 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/block/block/SystemMainBlock.php +++ b/core/modules/system/lib/Drupal/system/Plugin/block/block/SystemMainBlock.php @@ -23,9 +23,9 @@ class SystemMainBlock extends BlockBase { /** - * Implements \Drupal\block\BlockInterface::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { return array( drupal_set_page_content() ); diff --git a/core/modules/system/lib/Drupal/system/Plugin/block/block/SystemMenuBlock.php b/core/modules/system/lib/Drupal/system/Plugin/block/block/SystemMenuBlock.php index 6d3b837..0307257 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/block/block/SystemMenuBlock.php +++ b/core/modules/system/lib/Drupal/system/Plugin/block/block/SystemMenuBlock.php @@ -33,9 +33,9 @@ public function blockAccess() { } /** - * Implements \Drupal\block\BlockInterface::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { list($plugin, $derivative) = explode(':', $this->getPluginId()); // Derivatives are prefixed with 'menu-'. $menu = substr($derivative, 5); diff --git a/core/modules/system/lib/Drupal/system/Plugin/block/block/SystemPoweredByBlock.php b/core/modules/system/lib/Drupal/system/Plugin/block/block/SystemPoweredByBlock.php index 4b94df0..b363725 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/block/block/SystemPoweredByBlock.php +++ b/core/modules/system/lib/Drupal/system/Plugin/block/block/SystemPoweredByBlock.php @@ -23,9 +23,9 @@ class SystemPoweredByBlock extends BlockBase { /** - * Implements \Drupal\block\BlockInterface::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { return array( '#children' => theme('system_powered_by'), ); diff --git a/core/modules/user/lib/Drupal/user/Plugin/block/block/UserLoginBlock.php b/core/modules/user/lib/Drupal/user/Plugin/block/block/UserLoginBlock.php index 4ca502c..51bc8ee 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/block/block/UserLoginBlock.php +++ b/core/modules/user/lib/Drupal/user/Plugin/block/block/UserLoginBlock.php @@ -30,9 +30,9 @@ public function blockAccess() { } /** - * Implements \Drupal\block\BlockInterface::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { $form = drupal_get_form('user_login_form'); unset($form['name']['#attributes']['autofocus']); unset($form['name']['#description']); diff --git a/core/modules/user/lib/Drupal/user/Plugin/block/block/UserNewBlock.php b/core/modules/user/lib/Drupal/user/Plugin/block/block/UserNewBlock.php index 742cd89..7f97df6 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/block/block/UserNewBlock.php +++ b/core/modules/user/lib/Drupal/user/Plugin/block/block/UserNewBlock.php @@ -62,9 +62,9 @@ public function blockSubmit($form, &$form_state) { } /** - * Implements \Drupal\block\BlockInterface::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { // Retrieve a list of new users who have accessed the site successfully. $items = db_query_range('SELECT uid, name FROM {users} WHERE status <> 0 AND access <> 0 ORDER BY created DESC', 0, $this->configuration['whois_new_count'])->fetchAll(); $build = array( diff --git a/core/modules/user/lib/Drupal/user/Plugin/block/block/UserOnlineBlock.php b/core/modules/user/lib/Drupal/user/Plugin/block/block/UserOnlineBlock.php index 017a56f..b0caf90 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/block/block/UserOnlineBlock.php +++ b/core/modules/user/lib/Drupal/user/Plugin/block/block/UserOnlineBlock.php @@ -76,9 +76,9 @@ public function blockSubmit($form, &$form_state) { } /** - * Implements \Drupal\block\BlockInterface::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { // Count users active within the defined period. $interval = REQUEST_TIME - $this->configuration['seconds_online']; diff --git a/core/modules/views/lib/Drupal/views/Plugin/block/block/ViewsBlock.php b/core/modules/views/lib/Drupal/views/Plugin/block/block/ViewsBlock.php index 4131651..296212c 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/block/block/ViewsBlock.php +++ b/core/modules/views/lib/Drupal/views/Plugin/block/block/ViewsBlock.php @@ -69,9 +69,9 @@ public function blockForm($form, &$form_state) { } /** - * Implements \Drupal\block\BlockInterface::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { $output = $this->view->executeDisplay($this->displayID); // Set the subject to the title configured in the view. $this->configuration['subject'] = filter_xss_admin($this->view->getTitle()); diff --git a/core/modules/views/lib/Drupal/views/Plugin/block/block/ViewsExposedFilterBlock.php b/core/modules/views/lib/Drupal/views/Plugin/block/block/ViewsExposedFilterBlock.php index f274913..2d51c25 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/block/block/ViewsExposedFilterBlock.php +++ b/core/modules/views/lib/Drupal/views/Plugin/block/block/ViewsExposedFilterBlock.php @@ -23,9 +23,9 @@ class ViewsExposedFilterBlock extends ViewsBlock { /** - * Overrides \Drupal\views\Plugin\block\block\ViewsBlock::build(). + * Implements \Drupal\block\BlockBase::blockBuild(). */ - public function build() { + public function blockBuild() { $type = 'exp'; $output = $this->view->display_handler->viewSpecialBlocks($type); // Before returning the block output, convert it to a renderable array with