From bd5769d9fdc686664edd15c3f26bc9962a1d12ea Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Fri, 24 May 2013 10:14:30 -0700
Subject: [PATCH] Issue #1898034 by Cottser, jenlampton, joelpittet, Shawn
 DeArmond, idflood, Hydra, artofeclipse, rich.yumul, chrisjlee, gnuget, c4rl,
 thund3rbox: block.module - Convert PHPTemplate templates to Twig.

---
 core/modules/block/block.admin.inc            | 40 +++++++++----
 core/modules/block/block.api.php              |  2 +-
 core/modules/block/block.module               | 22 +++----
 .../block/Tests/BlockStorageUnitTest.php      | 18 +++---
 .../block-admin-display-form.html.twig        | 56 ++++++++++++++++++
 .../block-admin-display-form.tpl.php          | 58 ------------------
 core/modules/block/templates/block.html.twig  | 55 +++++++++++++++++
 core/modules/block/templates/block.tpl.php    | 59 -------------------
 core/modules/book/book.module                 |  2 +-
 core/modules/comment/comment.module           |  2 +-
 core/modules/edit/edit.module                 |  2 +-
 core/modules/forum/forum.module               |  2 +-
 core/modules/help/help.module                 |  2 +-
 core/modules/language/language.module         |  2 +-
 .../language/Tests/LanguageSwitchingTest.php  |  2 +-
 core/modules/menu/menu.module                 |  2 +-
 core/modules/node/node.module                 |  2 +-
 core/modules/search/search.module             |  2 +-
 core/modules/shortcut/shortcut.module         |  2 +-
 core/modules/statistics/statistics.module     |  2 +-
 core/modules/system/system.module             |  2 +-
 core/modules/user/user.module                 |  2 +-
 22 files changed, 178 insertions(+), 160 deletions(-)
 create mode 100644 core/modules/block/templates/block-admin-display-form.html.twig
 delete mode 100644 core/modules/block/templates/block-admin-display-form.tpl.php
 create mode 100644 core/modules/block/templates/block.html.twig
 delete mode 100644 core/modules/block/templates/block.tpl.php

diff --git a/core/modules/block/block.admin.inc b/core/modules/block/block.admin.inc
index f94ce257d1b3..6af9fe398314 100644
--- a/core/modules/block/block.admin.inc
+++ b/core/modules/block/block.admin.inc
@@ -6,6 +6,7 @@
  */
 
 use Drupal\block\Plugin\Core\Entity\Block;
+use Drupal\Core\Template\Attribute;
 
 /**
  * Page callback: Attaches CSS for the block region demo.
@@ -84,13 +85,13 @@ function block_admin_edit(Block $entity) {
 }
 
 /**
- * Processes variables for block-admin-display-form.tpl.php.
+ * Prepares variables for block admin display form templates.
  *
- * The $variables array contains the following arguments:
- * - $form
+ * Default template: block-admin-display-form.html.twig.
  *
- * @see block-admin-display.tpl.php
- * @see theme_block_admin_display()
+ * @param array $variables
+ *   An associative array containing:
+ *   - form: A render element representing the form.
  */
 function template_preprocess_block_admin_display_form(&$variables) {
   $variables['block_regions'] = $variables['form']['block_regions']['#value'];
@@ -103,6 +104,9 @@ function template_preprocess_block_admin_display_form(&$variables) {
     $variables['block_listing'][$key] = array();
   }
 
+  $default_attributes = new Attribute(array('class' => array('draggable')));
+  $row = 0;
+
   // Initialize disabled blocks array.
   $variables['block_listing'][BLOCK_REGION_NONE] = array();
 
@@ -118,14 +122,28 @@ function template_preprocess_block_admin_display_form(&$variables) {
     $block['weight']['#attributes']['class'] = array('block-weight', 'block-weight-' . $region);
 
     $variables['block_listing'][$region][$i] = new stdClass();
+    $variables['block_listing'][$region][$i]->attributes = clone $default_attributes;
+    $variables['block_listing'][$region][$i]->attributes['class'][] = $row % 2 == 0 ? 'odd' : 'even';
+    $row++;
+    if(!empty($block['#attributes']['class'])) {
+      $variables['block_listing'][$region][$i]->attributes['class'][] = implode(' ', $block['#attributes']['class']);
+    }
+
     $variables['block_listing'][$region][$i]->row_class = !empty($block['#attributes']['class']) ? implode(' ', $block['#attributes']['class']) : '';
     $variables['block_listing'][$region][$i]->block_modified = !empty($block['#attributes']['class']) && in_array('block-modified', $block['#attributes']['class']);
-    $variables['block_listing'][$region][$i]->block_title = drupal_render($block['info']);
-    $variables['block_listing'][$region][$i]->region_select = drupal_render($block['region']) . drupal_render($block['theme']);
-    $variables['block_listing'][$region][$i]->weight_select = drupal_render($block['weight']);
-    $variables['block_listing'][$region][$i]->operations = drupal_render($block['operations']);
+    $variables['block_listing'][$region][$i]->block_title = $block['info'];
+    $variables['block_listing'][$region][$i]->region_select = array(
+      'region' => array(
+        'data' => $block['region'],
+        '#weight' => 1,
+      ),
+      'theme' => array(
+        'data' => $block['theme'],
+        '#weight' => 2,
+      ),
+    );
+    $variables['block_listing'][$region][$i]->weight_select = $block['weight'];
+    $variables['block_listing'][$region][$i]->operations = $block['operations'];
     $variables['block_listing'][$region][$i]->printed = FALSE;
   }
-
-  $variables['form_submit'] = drupal_render_children($variables['form']);
 }
diff --git a/core/modules/block/block.api.php b/core/modules/block/block.api.php
index c2bf7ffd9e12..93a113a7743e 100644
--- a/core/modules/block/block.api.php
+++ b/core/modules/block/block.api.php
@@ -20,7 +20,7 @@
  * If the module wishes to act on the rendered HTML of the block rather than
  * the structured content array, it may use this hook to add a #post_render
  * callback. Alternatively, it could also implement hook_preprocess_HOOK() for
- * block.tpl.php. See drupal_render() and theme() documentation respectively
+ * block.html.twig. See drupal_render() and theme() documentation respectively
  * for details.
  *
  * In addition to hook_block_view_alter(), which is called for all blocks, there
diff --git a/core/modules/block/block.module b/core/modules/block/block.module
index d94ec3b3723c..8b24c9d91d6e 100644
--- a/core/modules/block/block.module
+++ b/core/modules/block/block.module
@@ -515,21 +515,23 @@ function block_rebuild() {
 }
 
 /**
- * Processes variables for block.tpl.php.
+ * Prepares variables for block templates.
+ *
+ * Default template: block.html.twig.
  *
  * Prepares the values passed to the theme_block function to be passed
  * into a pluggable template engine. Uses block properties to generate a
  * series of template file suggestions. If none are found, the default
- * block.tpl.php is used.
- *
- * Most themes utilize their own copy of block.tpl.php. The default is located
- * inside "modules/block/block.tpl.php". Look in there for the full list of
- * variables.
+ * block.html.twig is used.
  *
- * The $variables array contains the following arguments:
- * - $block
+ * Most themes use their own copy of block.html.twig. The default is located
+ * inside "core/modules/block/templates/block.html.twig". Look in there for the
+ * full list of available variables.
  *
- * @see block.tpl.php
+ * @param array $variables
+ *   An associative array containing:
+ *   - elements: An associative array containing the properties of the element.
+ *     Properties used: #block, #configuration, #children, #plugin_id.
  */
 function template_preprocess_block(&$variables) {
   $block_counter = &drupal_static(__FUNCTION__, array());
@@ -566,7 +568,7 @@ function template_preprocess_block(&$variables) {
   if ($id = $variables['elements']['#block']->id()) {
     $config_id = explode('.', $id);
     $machine_name = array_pop($config_id);
-    $variables['block_html_id'] = drupal_html_id('block-' . $machine_name);
+    $variables['attributes']['id'] = drupal_html_id('block-' . $machine_name);
     $variables['theme_hook_suggestions'][] = 'block__' . $machine_name;
   }
 }
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php
index dfc3b61bd21a..c3fbca308860 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php
@@ -135,11 +135,13 @@ protected function renderTests() {
     $entity = entity_load('block', 'stark.test_block');
     $output = entity_view($entity, 'block');
     $expected = array();
-    $expected[] = '  <div id="block-test-block"  class="block block-block-test">';
-    $expected[] = '';
+    $expected[] = '<div class="block block-block-test" id="block-test-block">';
+    $expected[] = '  ';
     $expected[] = '    ';
+    $expected[] = '';
     $expected[] = '  <div class="content">';
-    $expected[] = '      </div>';
+    $expected[] = '    ';
+    $expected[] = '  </div>';
     $expected[] = '</div>';
     $expected[] = '';
     $expected_output = implode("\n", $expected);
@@ -159,12 +161,14 @@ protected function renderTests() {
     $entity->save();
     $output = entity_view($entity, 'block');
     $expected = array();
-    $expected[] = '  <div id="block-test-block2"  class="block block-block-test">';
-    $expected[] = '';
-    $expected[] = '    <h2>Powered by Bananas</h2>';
+    $expected[] = '<div class="block block-block-test" id="block-test-block2">';
     $expected[] = '  ';
+    $expected[] = '      <h2>Powered by Bananas</h2>';
+    $expected[] = '    ';
+    $expected[] = '';
     $expected[] = '  <div class="content">';
-    $expected[] = '      </div>';
+    $expected[] = '    ';
+    $expected[] = '  </div>';
     $expected[] = '</div>';
     $expected[] = '';
     $expected_output = implode("\n", $expected);
diff --git a/core/modules/block/templates/block-admin-display-form.html.twig b/core/modules/block/templates/block-admin-display-form.html.twig
new file mode 100644
index 000000000000..545a06cca447
--- /dev/null
+++ b/core/modules/block/templates/block-admin-display-form.html.twig
@@ -0,0 +1,56 @@
+{#
+/**
+ * @file
+ * Default theme implementation to configure blocks.
+ *
+ * Available variables:
+ * - block_regions: A collection of regions. Keyed by name with the title as value.
+ * - block_listing: A collection of blocks keyed by region and then delta.
+ * - form: The form elements.
+ *
+ * Each block_listing[region] contains a collection of blocks for that region.
+ * - data: Each data in block_listing[region] contains.
+ *    - region_title: Region title for the listed block.
+ *    - block_title: Block title.
+ *    - region_select: Drop-down menu for assigning a region.
+ *    - weight_select: Drop-down menu for setting weights.
+ *    - operations: Block operations.
+ *
+ * @see template_preprocess()
+ * @see template_preprocess_block_admin_display_form()
+ *
+ * @ingroup themeable
+ */
+#}
+<table id="blocks" class="sticky-enabled">
+  <thead>
+    <tr>
+      <th>{{ 'Block'|t }}</th>
+      <th>{{ 'Region'|t }}</th>
+      <th>{{ 'Weight'|t }}</th>
+      <th>{{ 'Operations'|t }}</th>
+    </tr>
+  </thead>
+  <tbody>
+    {% set row = 0 %}
+    {% for region, title in block_regions %}
+      <tr class="region-title region-title-{{ region }}">
+        <td colspan="5">{{ title }}</td>
+      </tr>
+      <tr class="region-message region-{{ region }}-message {{ block_listing[region] is empty ? 'region-empty' : 'region-populated' }}">
+        <td colspan="5"><em>{{ 'No blocks in this region'|t }}</em></td>
+      </tr>
+      {% for delta, data in block_listing[region] %}
+      <tr{{ data.attributes }}>
+        <td class="block">{{ data.block_title }}</td>
+        <td>{{ data.region_select }}</td>
+        <td>{{ data.weight_select }}</td>
+        <td>{{ data.operations }}</td>
+      </tr>
+      {% set row = row + 1 %}
+      {% endfor %}
+    {% endfor %}
+  </tbody>
+</table>
+
+{{ form }}
diff --git a/core/modules/block/templates/block-admin-display-form.tpl.php b/core/modules/block/templates/block-admin-display-form.tpl.php
deleted file mode 100644
index 4fa3e703004f..000000000000
--- a/core/modules/block/templates/block-admin-display-form.tpl.php
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-
-/**
- * @file
- * Default theme implementation to configure blocks.
- *
- * Available variables:
- * - $block_regions: An array of regions. Keyed by name with the title as value.
- * - $block_listing: An array of blocks keyed by region and then delta.
- * - $form_submit: Form submit button.
- *
- * Each $block_listing[$region] contains an array of blocks for that region.
- *
- * Each $data in $block_listing[$region] contains:
- * - $data->region_title: Region title for the listed block.
- * - $data->block_title: Block title.
- * - $data->region_select: Drop-down menu for assigning a region.
- * - $data->weight_select: Drop-down menu for setting weights.
- * - $data->operations: Block operations.
- *
- * @see template_preprocess_block_admin_display_form()
- * @see theme_block_admin_display()
- *
- * @ingroup themeable
- */
-?>
-<table id="blocks" class="sticky-enabled">
-  <thead>
-    <tr>
-      <th><?php print t('Block'); ?></th>
-      <th><?php print t('Region'); ?></th>
-      <th><?php print t('Weight'); ?></th>
-      <th><?php print t('Operations'); ?></th>
-    </tr>
-  </thead>
-  <tbody>
-    <?php $row = 0; ?>
-    <?php foreach ($block_regions as $region => $title): ?>
-      <tr class="region-title region-title-<?php print $region?>">
-        <td colspan="5"><?php print $title; ?></td>
-      </tr>
-      <tr class="region-message region-<?php print $region?>-message <?php print empty($block_listing[$region]) ? 'region-empty' : 'region-populated'; ?>">
-        <td colspan="5"><em><?php print t('No blocks in this region'); ?></em></td>
-      </tr>
-      <?php foreach ($block_listing[$region] as $delta => $data): ?>
-      <tr class="draggable <?php print $row % 2 == 0 ? 'odd' : 'even'; ?><?php print $data->row_class ? ' ' . $data->row_class : ''; ?>">
-        <td class="block"><?php print $data->block_title; ?></td>
-        <td><?php print $data->region_select; ?></td>
-        <td><?php print $data->weight_select; ?></td>
-        <td><?php print $data->operations; ?></td>
-      </tr>
-      <?php $row++; ?>
-      <?php endforeach; ?>
-    <?php endforeach; ?>
-  </tbody>
-</table>
-
-<?php print $form_submit; ?>
diff --git a/core/modules/block/templates/block.html.twig b/core/modules/block/templates/block.html.twig
new file mode 100644
index 000000000000..757f8f5053b4
--- /dev/null
+++ b/core/modules/block/templates/block.html.twig
@@ -0,0 +1,55 @@
+{#
+/**
+ * @file
+ * Default theme implementation to display a block.
+ *
+ * Available variables:
+ * - plugin_id: The ID of the block implementation.
+ * - label: The configured label of the block if visible.
+ * - configuration: A list of the block's configuration values.
+ *   - label: The configured label for the block.
+ *   - label_display: The display settings for the label.
+ *   - module: The module that provided this block plugin.
+ *   - cache: The cache settings.
+ *   - Block plugin specific settings will also be stored here.
+ * - block - The full block entity.
+ *   - label_hidden: The hidden block title value if the block was
+ *     configured to hide the title ('label' is empty in this case).
+ *   - module: The module that generated the block.
+ *   - delta: An ID for the block, unique within each module.
+ *   - region: The block region embedding the current block.
+ * - content: The content of this block.
+ * - attributes: HTML attributes for the containing element.
+ *   - id: A valid HTML ID and guaranteed unique.
+ *   - class: Classes that can be used to style contextually through
+ *     CSS. These can be manipulated through preprocess functions. The default
+ *     values can be one or more of the following:
+ *     - block: The current template type, i.e., "theming hook".
+ *     - block-[module]: The module generating the block. For example, the user
+ *       module is responsible for handling the default user navigation block.
+ *       In that case the class would be 'block-user'.
+ * - title_attributes: HTML attributes for the title element.
+ * - content_attributes: HTML attributes for the content element.
+ * - title_prefix: Additional output populated by modules, intended to be
+ *   displayed in front of the main title tag that appears in the template.
+ * - title_suffix: Additional output populated by modules, intended to be
+ *   displayed after the main title tag that appears in the template.
+ *
+ * @see template_preprocess()
+ * @see template_preprocess_block()
+ *
+ * @ingroup themeable
+ */
+ @todo Remove the div around content as per http://drupal.org/node/1972122.
+#}
+<div{{ attributes }}>
+  {{ title_prefix }}
+  {% if label %}
+    <h2{{ title_attributes }}>{{ label }}</h2>
+  {% endif %}
+  {{ title_suffix }}
+
+  <div{{ content_attributes }}>
+    {{ content }}
+  </div>
+</div>
diff --git a/core/modules/block/templates/block.tpl.php b/core/modules/block/templates/block.tpl.php
deleted file mode 100644
index 106dd6b3566b..000000000000
--- a/core/modules/block/templates/block.tpl.php
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-
-/**
- * @file
- * Default theme implementation to display a block.
- *
- * Available variables:
- * - $plugin_id: The ID of the block implementation.
- * - $label: The configured label of the block if visible.
- * - $configuration: An array of the block's configuration values.
- *   - label: The configured label for the block.
- *   - label_display: The display settings for the label.
- *   - module: The module that provided this block plugin.
- *   - cache: The cache settings.
- *   - Block plugin specific settings will also be stored here.
- * - $content: Block content.
- * - $attributes: An instance of Attributes class that can be manipulated as an
- *    array and printed as a string.
- *    It includes the 'class' information, which includes:
- *   - block: The current template type, i.e., "theming hook".
- *   - block-[module]: The module generating the block. For example, the user
- *     module is responsible for handling the default user navigation block. In
- *     that case the class would be 'block-user'.
- * - $title_prefix (array): An array containing additional output populated by
- *   modules, intended to be displayed in front of the main title tag that
- *   appears in the template.
- * - $title_suffix (array): An array containing additional output populated by
- *   modules, intended to be displayed after the main title tag that appears in
- *   the template.
- *
- * Helper variables:
- * - $is_front: Flags true when presented in the front page.
- * - $logged_in: Flags true when the current user is a logged-in member.
- * - $is_admin: Flags true when the current user is an administrator.
- * - $block_html_id: A valid HTML ID and guaranteed unique.
- *
- * @see template_preprocess()
- * @see template_preprocess_block()
- * @see template_process()
- *
- * @ingroup themeable
- */
-?>
-<?php if (isset($block_html_id)): ?>
-  <div id="<?php print $block_html_id; ?>" <?php print $attributes; ?>>
-<?php else: ?>
-  <div <?php print $attributes; ?>>
-<?php endif; ?>
-
-  <?php print render($title_prefix); ?>
-<?php if ($label): ?>
-  <h2<?php print $title_attributes; ?>><?php print $label; ?></h2>
-<?php endif;?>
-  <?php print render($title_suffix); ?>
-
-  <div<?php print $content_attributes; ?>>
-    <?php print render($content) ?>
-  </div>
-</div>
diff --git a/core/modules/book/book.module b/core/modules/book/book.module
index 4ae3740a2dec..59f1e45c7d59 100644
--- a/core/modules/book/book.module
+++ b/core/modules/book/book.module
@@ -948,7 +948,7 @@ function _book_link_defaults($nid) {
 }
 
  /**
- * Implements hook_preprocess_HOOK() for block.tpl.php.
+ * Implements hook_preprocess_HOOK() for block.html.twig.
  */
 function book_preprocess_block(&$variables) {
   if ($variables['configuration']['module'] == 'book') {
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index 807b672c7fa5..b2d0190914f9 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -1526,7 +1526,7 @@ function comment_preview(Comment $comment) {
 }
 
 /**
- * Implements hook_preprocess_HOOK() for block.tpl.php.
+ * Implements hook_preprocess_HOOK() for block.html.twig.
  */
 function comment_preprocess_block(&$variables) {
   if ($variables['configuration']['module'] == 'comment') {
diff --git a/core/modules/edit/edit.module b/core/modules/edit/edit.module
index 7e1d1fe0c11e..5b115607aa70 100644
--- a/core/modules/edit/edit.module
+++ b/core/modules/edit/edit.module
@@ -157,7 +157,7 @@ function edit_preprocess_taxonomy_term(&$variables) {
 }
 
 /**
- * Implements hook_preprocess_HOOK() for block.tpl.php.
+ * Implements hook_preprocess_HOOK() for block.html.twig.
  *
  * @todo Remove this, handle in generic way: http://drupal.org/node/1972514.
  */
diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module
index dfe04f219deb..1a5e0091ecc6 100644
--- a/core/modules/forum/forum.module
+++ b/core/modules/forum/forum.module
@@ -973,7 +973,7 @@ function forum_get_topics($tid, $sortby, $forum_per_page) {
 }
 
 /**
- * Implements hook_preprocess_HOOK() for block.tpl.php.
+ * Implements hook_preprocess_HOOK() for block.html.twig.
  */
 function forum_preprocess_block(&$variables) {
   if ($variables['configuration']['module'] == 'forum') {
diff --git a/core/modules/help/help.module b/core/modules/help/help.module
index d7042d320075..4c347f95c5dc 100644
--- a/core/modules/help/help.module
+++ b/core/modules/help/help.module
@@ -66,7 +66,7 @@ function help_help($path, $arg) {
 }
 
 /**
- * Implements hook_preprocess_HOOK() for block.tpl.php.
+ * Implements hook_preprocess_HOOK() for block.html.twig.
  */
 function help_preprocess_block(&$variables) {
   if ($variables['plugin_id'] == 'system_help_block') {
diff --git a/core/modules/language/language.module b/core/modules/language/language.module
index 6294f3143fcb..1dd936fc8df9 100644
--- a/core/modules/language/language.module
+++ b/core/modules/language/language.module
@@ -760,7 +760,7 @@ function language_language_delete($language) {
 }
 
 /**
- * Implements hook_preprocess_HOOK() for block.tpl.php.
+ * Implements hook_preprocess_HOOK() for block.html.twig.
  */
 function language_preprocess_block(&$variables) {
   if ($variables['configuration']['module'] == 'language') {
diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageSwitchingTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageSwitchingTest.php
index 8088f6a64d97..47a61e73238a 100644
--- a/core/modules/language/lib/Drupal/language/Tests/LanguageSwitchingTest.php
+++ b/core/modules/language/lib/Drupal/language/Tests/LanguageSwitchingTest.php
@@ -59,7 +59,7 @@ function testLanguageBlock() {
     $this->assertText($block->label(), 'Language switcher block found.');
 
     // Assert that only the current language is marked as active.
-    list($language_switcher) = $this->xpath('//div[@id=:id]/div[@class="content"]', array(':id' => 'block-test-language-block'));
+    list($language_switcher) = $this->xpath('//div[@id=:id]/div[contains(@class, "content")]', array(':id' => 'block-test-language-block'));
     $links = array(
       'active' => array(),
       'inactive' => array(),
diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module
index 93c2ed815203..1b43a4e458ef 100644
--- a/core/modules/menu/menu.module
+++ b/core/modules/menu/menu.module
@@ -713,7 +713,7 @@ function menu_get_menus($all = TRUE) {
 }
 
 /**
- * Implements hook_preprocess_HOOK() for block.tpl.php.
+ * Implements hook_preprocess_HOOK() for block.html.twig.
  */
 function menu_preprocess_block(&$variables) {
   if ($variables['configuration']['module'] == 'menu') {
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index 23bf4be000e0..1e1084e5738e 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -1074,7 +1074,7 @@ function node_is_page(EntityInterface $node) {
 }
 
 /**
- * Implements hook_preprocess_HOOK() for block.tpl.php.
+ * Implements hook_preprocess_HOOK() for block.html.twig.
  */
 function node_preprocess_block(&$variables) {
   if ($variables['configuration']['module'] == 'node') {
diff --git a/core/modules/search/search.module b/core/modules/search/search.module
index f31488be21b7..efaf03187813 100644
--- a/core/modules/search/search.module
+++ b/core/modules/search/search.module
@@ -135,7 +135,7 @@ function search_permission() {
 }
 
 /**
- * Implements hook_preprocess_HOOK() for block.tpl.php.
+ * Implements hook_preprocess_HOOK() for block.html.twig.
  */
 function search_preprocess_block(&$variables) {
   if ($variables['plugin_id'] == 'search_form_block') {
diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module
index d1458a85940d..2da3d2608c15 100644
--- a/core/modules/shortcut/shortcut.module
+++ b/core/modules/shortcut/shortcut.module
@@ -447,7 +447,7 @@ function shortcut_renderable_links($shortcut_set = NULL) {
 }
 
 /**
- * Implements hook_preprocess_HOOK() for block.tpl.php.
+ * Implements hook_preprocess_HOOK() for block.html.twig.
  */
 function shortcut_preprocess_block(&$variables) {
   if ($variables['configuration']['module'] == 'shortcut') {
diff --git a/core/modules/statistics/statistics.module b/core/modules/statistics/statistics.module
index 9d0c19eda66d..7b1528161c46 100644
--- a/core/modules/statistics/statistics.module
+++ b/core/modules/statistics/statistics.module
@@ -234,7 +234,7 @@ function statistics_update_index() {
 }
 
 /**
- * Implements hook_preprocess_HOOK() for block.tpl.php.
+ * Implements hook_preprocess_HOOK() for block.html.twig.
  */
 function statistics_preprocess_block(&$variables) {
   if ($variables['configuration']['module'] == 'statistics') {
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index b3ea7647e37e..cbf9f4475d10 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -2664,7 +2664,7 @@ function system_user_timezone(&$form, &$form_state) {
 }
 
 /**
- * Implements hook_preprocess_HOOK() for block.tpl.php.
+ * Implements hook_preprocess_HOOK() for block.html.twig.
  */
 function system_preprocess_block(&$variables) {
   // Derive the base plugin ID.
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index d02a91ae82e3..0b884fa5842d 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -646,7 +646,7 @@ function user_validate_current_pass(&$form, &$form_state) {
 }
 
 /**
- * Implements hook_preprocess_HOOK() for block.tpl.php.
+ * Implements hook_preprocess_HOOK() for block.html.twig.
  */
 function user_preprocess_block(&$variables) {
   if ($variables['configuration']['module'] == 'user') {
-- 
GitLab