diff -u b/core/modules/aggregator/src/Tests/ImportOpmlTest.php b/core/modules/aggregator/src/Tests/ImportOpmlTest.php --- b/core/modules/aggregator/src/Tests/ImportOpmlTest.php +++ b/core/modules/aggregator/src/Tests/ImportOpmlTest.php @@ -33,7 +33,7 @@ */ function openImportForm() { // Enable the help block. - $this->drupalPlaceBlock('system_help_block', array('region' => 'help')); + $this->drupalPlaceBlock('contextual_help_block', array('region' => 'help')); $this->drupalGet('admin/config/services/aggregator/add/opml'); $this->assertText('A single OPML document may contain many feeds.', 'Found OPML help text.'); diff -u b/core/modules/block/src/Tests/BlockUiTest.php b/core/modules/block/src/Tests/BlockUiTest.php --- b/core/modules/block/src/Tests/BlockUiTest.php +++ b/core/modules/block/src/Tests/BlockUiTest.php @@ -80,7 +80,7 @@ * Test block demo page exists and functions correctly. */ public function testBlockDemoUiPage() { - $this->drupalPlaceBlock('system_help_block', array('region' => 'help')); + $this->drupalPlaceBlock('contextual_help_block', array('region' => 'help')); $this->drupalGet('admin/structure/block'); $this->clickLink(t('Demonstrate block regions (@theme)', array('@theme' => 'Classy'))); $elements = $this->xpath('//div[contains(@class, "region-highlighted")]/div[contains(@class, "block-region") and contains(text(), :title)]', array(':title' => 'Highlighted')); reverted: --- b/core/modules/help/src/Plugin/Block/SystemHelpBlock.php +++ a/core/modules/system/src/Plugin/Block/SystemHelpBlock.php @@ -2,10 +2,10 @@ /** * @file + * Contains \Drupal\system\Plugin\Block\SystemHelpBlock. - * Contains \Drupal\help\Plugin\Block\SystemHelpBlock. */ +namespace Drupal\system\Plugin\Block; -namespace Drupal\help\Plugin\Block; use Drupal\Core\Block\BlockBase; use Drupal\Core\Extension\ModuleHandlerInterface; diff -u b/core/modules/node/src/Tests/NodeTranslationUITest.php b/core/modules/node/src/Tests/NodeTranslationUITest.php --- b/core/modules/node/src/Tests/NodeTranslationUITest.php +++ b/core/modules/node/src/Tests/NodeTranslationUITest.php @@ -38,7 +38,7 @@ parent::setUp(); // Ensure the help message is shown even with prefixed paths. - $this->drupalPlaceBlock('system_help_block', array('region' => 'content')); + $this->drupalPlaceBlock('contextual_help_block', array('region' => 'content')); // Display the language selector. $this->drupalLogin($this->administrator); diff -u b/core/modules/system/system.module b/core/modules/system/system.module --- b/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -88,11 +88,9 @@ $output .= '
' . t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Bartik, for example, implements the regions "Sidebar first", "Sidebar second", "Featured", "Content", "Header", "Footer", etc., and a block may appear in any one of these areas. The blocks administration page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array('!blocks' => \Drupal::url('block.admin_display'))) . '
'; + + // Help for another path in the block module. + case 'block.admin_display': + return '' . t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the Save blocks button at the bottom of the page.') . '
'; + } +} + +/** + * @} End of "addtogroup hooks". + */ only in patch2: unchanged: --- a/core/modules/system/src/Plugin/Block/SystemHelpBlock.php +++ b/core/modules/help/src/Plugin/Block/ContextualHelpBlock.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\system\Plugin\Block\SystemHelpBlock. + * Contains \Drupal\help\Plugin\Block\ContextualHelpBlock. */ -namespace Drupal\system\Plugin\Block; +namespace Drupal\help\Plugin\Block; use Drupal\Core\Block\BlockBase; use Drupal\Core\Extension\ModuleHandlerInterface; @@ -16,14 +16,14 @@ use Symfony\Component\HttpFoundation\Request; /** - * Provides a 'System Help' block. + * Provides a 'Contextual Help' block. * * @Block( - * id = "system_help_block", - * admin_label = @Translation("System Help") + * id = "contextual_help_block", + * admin_label = @Translation("Contextual Help") * ) */ -class SystemHelpBlock extends BlockBase implements ContainerFactoryPluginInterface { +class ContextualHelpBlock extends BlockBase implements ContainerFactoryPluginInterface { /** * Stores the help text associated with the active menu item. @@ -54,7 +54,7 @@ class SystemHelpBlock extends BlockBase implements ContainerFactoryPluginInterfa protected $routeMatch; /** - * Creates a SystemHelpBlock instance. + * Creates a ContextualHelpBlock instance. * * @param array $configuration * A configuration array containing information about the plugin instance. @@ -128,8 +128,8 @@ public function build() { * {@inheritdoc} */ public function defaultConfiguration() { - // Modify the default max age for the System Help block: help text is static - // for a given URL, except when a module is updated, in which case + // Modify the default max age for the Contextual Help block: help text is + // static for a given URL, except when a module is updated, in which case // update.php must be run, which clears all caches. Thus it's safe to cache // the output for this block forever on a per-URL basis. return array('cache' => array('max_age' => \Drupal\Core\Cache\Cache::PERMANENT)); @@ -139,7 +139,7 @@ public function defaultConfiguration() { * {@inheritdoc} */ protected function getRequiredCacheContexts() { - // The "System Help" block must be cached per URL: help is defined for a + // The "Contextual Help" block must be cached per URL: help is defined for a // given path, and does not come with any access restrictions. return array('cache_context.url'); } only in patch2: unchanged: --- a/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -376,49 +376,6 @@ function hook_system_breadcrumb_alter(array &$breadcrumb, \Drupal\Core\Routing\R } /** - * Provide online user help. - * - * By implementing hook_help(), a module can make documentation available to - * the user for the module as a whole, or for specific pages. Help for - * developers should usually be provided via function header comments in the - * code, or in special API example files. - * - * The page-specific help information provided by this hook appears as a system - * help block on that page. The module overview help information is displayed - * by the Help module. It can be accessed from the page at admin/help or from - * the Extend page. - * - * For detailed usage examples of: - * - Module overview help, see content_translation_help(). Module overview - * help should follow - * @link https://drupal.org/node/632280 the standard help template. @endlink - * - Page-specific help using only routes, see book_help(). - * - Page-specific help using routes and $request, see block_help(). - * - * @param string $route_name - * For page-specific help, use the route name as identified in the - * module's routing.yml file. For module overview help, the route name - * will be in the form of "help.page.$modulename". - * @param Drupal\Core\Routing\RouteMatchInterface $route_match - * The current route match. This can be used to generate different help - * output for different pages that share the same route. - * - * @return string - * A localized string containing the help text. - */ -function hook_help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_match) { - switch ($route_name) { - // Main module help for the block module. - case 'help.page.block': - return '' . t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Bartik, for example, implements the regions "Sidebar first", "Sidebar second", "Featured", "Content", "Header", "Footer", etc., and a block may appear in any one of these areas. The blocks administration page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array('!blocks' => \Drupal::url('block.admin_display'))) . '
'; - - // Help for another path in the block module. - case 'block.admin_display': - return '' . t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the Save blocks button at the bottom of the page.') . '
'; - } -} - -/** * Prepare a message based on parameters; called from drupal_mail(). * * Note that hook_mail(), unlike hook_mail_alter(), is only called on the only in patch2: unchanged: --- a/core/profiles/standard/src/Tests/StandardTest.php +++ b/core/profiles/standard/src/Tests/StandardTest.php @@ -48,7 +48,7 @@ function testStandard() { $this->drupalGet(''); $this->assertText('Main navigation'); - // Verify we have role = aria on system_powered_by and system_help_block + // Verify we have role = aria on system_powered_by and contextual_help_block // blocks. $this->drupalGet('admin/structure/block'); $elements = $this->xpath('//div[@role=:role and @id=:id]', array(