diff options
Diffstat (limited to 'core/modules/comment/src')
4 files changed, 26 insertions, 4 deletions
diff --git a/core/modules/comment/src/Hook/CommentThemeHooks.php b/core/modules/comment/src/Hook/CommentThemeHooks.php new file mode 100644 index 00000000000..c137d586d41 --- /dev/null +++ b/core/modules/comment/src/Hook/CommentThemeHooks.php @@ -0,0 +1,22 @@ +<?php + +namespace Drupal\comment\Hook; + +use Drupal\Core\Hook\Attribute\Hook; + +/** + * Hook implementations for comment. + */ +class CommentThemeHooks { + + /** + * Implements hook_preprocess_HOOK() for block templates. + */ + #[Hook('preprocess_block')] + public function preprocessBlock(&$variables): void { + if ($variables['configuration']['provider'] == 'comment') { + $variables['attributes']['role'] = 'navigation'; + } + } + +} diff --git a/core/modules/comment/src/Hook/CommentTokensHooks.php b/core/modules/comment/src/Hook/CommentTokensHooks.php index 7d7e9d0c03f..630e74e8752 100644 --- a/core/modules/comment/src/Hook/CommentTokensHooks.php +++ b/core/modules/comment/src/Hook/CommentTokensHooks.php @@ -47,7 +47,7 @@ class CommentTokensHooks { ]; } } - // Core comment tokens + // Core comment tokens. $comment['cid'] = ['name' => $this->t("Comment ID"), 'description' => $this->t("The unique ID of the comment.")]; $comment['uuid'] = ['name' => $this->t('UUID'), 'description' => $this->t("The UUID of the comment.")]; $comment['hostname'] = [ @@ -76,7 +76,7 @@ class CommentTokensHooks { 'name' => $this->t("Edit URL"), 'description' => $this->t("The URL of the comment's edit page."), ]; - // Chained tokens for comments + // Chained tokens for comments. $comment['created'] = [ 'name' => $this->t("Date created"), 'description' => $this->t("The date the comment was posted."), diff --git a/core/modules/comment/src/Plugin/views/field/LastTimestamp.php b/core/modules/comment/src/Plugin/views/field/LastTimestamp.php index c0bd35f30ca..3f1698d1236 100644 --- a/core/modules/comment/src/Plugin/views/field/LastTimestamp.php +++ b/core/modules/comment/src/Plugin/views/field/LastTimestamp.php @@ -9,7 +9,7 @@ use Drupal\views\ResultRow; use Drupal\views\ViewExecutable; /** - * Field handler to display the timestamp of a comment with the count of comments. + * Displays the timestamp of a comment with the count of comments. * * @ingroup views_field_handlers */ diff --git a/core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php b/core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php index 098b6855c56..045258af50a 100644 --- a/core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php +++ b/core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php @@ -39,7 +39,7 @@ class StatisticsLastCommentName extends FieldPluginBase { // last_comment_name only contains data if the user is anonymous. So we // have to join in a specially related user table. $this->ensureMyTable(); - // Join 'users' to this table via vid + // Join 'users' to this table via vid. $definition = [ 'table' => 'users_field_data', 'field' => 'uid', |