From de537bdba1c0cc2d74f9de6a0a32e9503eb8e670 Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Mon, 18 Oct 2021 13:08:44 +0100 Subject: [PATCH] Issue #3236443 by paulocs, benjifisher, marcos_lima: Link to module-specific permissions forms in Help pages --- .../help_topics/help_topics/action.creating.html.twig | 2 +- .../help_topics/help_topics/comment.configuring.html.twig | 2 +- .../help_topics/help_topics/comment.creating_type.html.twig | 2 +- .../help_topics/help_topics/comment.disabling.html.twig | 2 +- .../help_topics/help_topics/comment.moderating.html.twig | 2 +- .../help_topics/content_moderation.changing_states.html.twig | 2 +- .../content_moderation.configuring_workflows.html.twig | 4 ++-- .../help_topics/help_topics/node.creating_content.html.twig | 2 +- .../help_topics/help_topics/node.creating_type.html.twig | 2 +- core/modules/help_topics/help_topics/node.editing.html.twig | 2 +- .../help_topics/help_topics/path.creating_alias.html.twig | 2 +- .../help_topics/help_topics/path.editing_alias.html.twig | 2 +- .../help_topics/help_topics/taxonomy.configuring.html.twig | 2 +- .../help_topics/views_ui.bulk_operations.html.twig | 2 +- core/modules/layout_builder/layout_builder.module | 2 +- core/modules/media/media.module | 2 +- core/modules/node/node.module | 2 +- core/modules/path/path.module | 2 +- core/modules/quickedit/quickedit.module | 2 +- core/modules/search/search.module | 4 ++-- core/modules/settings_tray/settings_tray.module | 2 +- core/modules/statistics/statistics.module | 2 +- core/modules/system/system.module | 5 ++--- .../modules/system/tests/src/Functional/System/AdminTest.php | 2 +- core/modules/taxonomy/taxonomy.module | 2 +- 25 files changed, 28 insertions(+), 29 deletions(-) diff --git a/core/modules/help_topics/help_topics/action.creating.html.twig b/core/modules/help_topics/help_topics/action.creating.html.twig index d4f96168fd24..76a53ce6e220 100644 --- a/core/modules/help_topics/help_topics/action.creating.html.twig +++ b/core/modules/help_topics/help_topics/action.creating.html.twig @@ -11,7 +11,7 @@ related: {% set action_permissions_link_text %} {% trans %}Administer actions{% endtrans %} {% endset %} -{% set action_permissions = render_var(help_route_link(action_permissions_link_text, 'user.admin_permissions', {}, {'fragment': 'module-action'})) %} +{% set action_permissions = render_var(help_route_link(action_permissions_link_text, 'user.admin_permissions.module', {'modules': 'action'})) %} {% set action_overview = render_var(help_topic_link('action.overview')) %} <h2>{% trans %}Goal{% endtrans %}</h2> <p>{% trans %}Create an advanced action. You can, for example, create an action to change the author of multiple content items. See {{ action_overview }} for more about actions.{% endtrans %}</p> diff --git a/core/modules/help_topics/help_topics/comment.configuring.html.twig b/core/modules/help_topics/help_topics/comment.configuring.html.twig index 2fd76b831d62..a3639938c40b 100644 --- a/core/modules/help_topics/help_topics/comment.configuring.html.twig +++ b/core/modules/help_topics/help_topics/comment.configuring.html.twig @@ -9,7 +9,7 @@ related: {% set comment_permissions_link_text %} {% trans %}Administer comments and comment settings{% endtrans %} {% endset %} -{% set comment_permissions_link = render_var(help_route_link(comment_permissions_link_text, 'user.admin_permissions', {}, {'fragment': 'module-comment'})) %} +{% set comment_permissions_link = render_var(help_route_link(comment_permissions_link_text, 'user.admin_permissions.module', {'modules': 'comment'})) %} {% set content_structure_topic = render_var(help_topic_link('core.content_structure')) %} {% set comment_type_topic = render_var(help_topic_link('comment.creating_type')) %} <h2>{% trans %}Goal{% endtrans %}</h2> diff --git a/core/modules/help_topics/help_topics/comment.creating_type.html.twig b/core/modules/help_topics/help_topics/comment.creating_type.html.twig index 0d1e07ff62ca..1c6a9240f7ae 100644 --- a/core/modules/help_topics/help_topics/comment.creating_type.html.twig +++ b/core/modules/help_topics/help_topics/comment.creating_type.html.twig @@ -14,7 +14,7 @@ related: {% set comment_permissions_link_text %} {% trans %}Administer comment types and settings{% endtrans %} {% endset %} -{% set comment_permissions_link = render_var(help_route_link(comment_permissions_link_text, 'user.admin_permissions', {}, {'fragment': 'module-comment'})) %} +{% set comment_permissions_link = render_var(help_route_link(comment_permissions_link_text, 'user.admin_permissions.module', {'modules': 'comment'})) %} {% set comment_overview_topic = render_var(help_topic_link('comment.overview')) %} {% set content_structure_topic = render_var(help_topic_link('core.content_structure')) %} <h2>{% trans %}Goal{% endtrans %}</h2> diff --git a/core/modules/help_topics/help_topics/comment.disabling.html.twig b/core/modules/help_topics/help_topics/comment.disabling.html.twig index 77ec431fcec3..0929da4e14de 100644 --- a/core/modules/help_topics/help_topics/comment.disabling.html.twig +++ b/core/modules/help_topics/help_topics/comment.disabling.html.twig @@ -7,7 +7,7 @@ related: {% set comment_permissions_text %} {% trans %}Administer comments and comment settings{% endtrans %} {% endset %} -{% set comment_permissions_link = render_var(help_route_link(comment_permissions_text, 'user.admin_permissions', {}, {'fragment': 'module-comment'})) %} +{% set comment_permissions_link = render_var(help_route_link(comment_permissions_text, 'user.admin_permissions.module', {'modules': 'comment'})) %} {% set comment_config_topic = render_var(help_topic_link('comment.configuring')) %} {% set content_structure_topic = render_var(help_topic_link('core.content_structure')) %} <h2>{% trans %}Goal{% endtrans %}</h2> diff --git a/core/modules/help_topics/help_topics/comment.moderating.html.twig b/core/modules/help_topics/help_topics/comment.moderating.html.twig index 6013c033fd0b..6e9a2e304e25 100644 --- a/core/modules/help_topics/help_topics/comment.moderating.html.twig +++ b/core/modules/help_topics/help_topics/comment.moderating.html.twig @@ -16,7 +16,7 @@ related: {% set comment_permissions_link_text %} {% trans %}Administer comments and comment settings{% endtrans %} {% endset %} -{% set comment_permissions_link = render_var(help_route_link(comment_permissions_link_text, 'user.admin_permissions', {}, {'fragment': 'module-comment'})) %} +{% set comment_permissions_link = render_var(help_route_link(comment_permissions_link_text, 'user.admin_permissions.module', {'modules': 'comment'})) %} <h2>{% trans %}Goal{% endtrans %}</h2> <p>{% trans %}Decide which comments are shown on the website.{% endtrans %}</p> <h2>{% trans %}Who can moderate comments?{% endtrans %}</h2> diff --git a/core/modules/help_topics/help_topics/content_moderation.changing_states.html.twig b/core/modules/help_topics/help_topics/content_moderation.changing_states.html.twig index d8dcc03df378..5eec3f11f1a0 100644 --- a/core/modules/help_topics/help_topics/content_moderation.changing_states.html.twig +++ b/core/modules/help_topics/help_topics/content_moderation.changing_states.html.twig @@ -7,7 +7,7 @@ related: --- {% set workflows_overview_topic = render_var(help_topic_link('workflows.overview')) %} {% set content_structure_topic = render_var(help_topic_link('core.content_structure')) %} -{% set content_moderation_permissions = render_var(url('user.admin_permissions', {}, {'fragment': 'module-content_moderation'})) %} +{% set content_moderation_permissions = render_var(url('user.admin_permissions.module', {'modules': 'content_moderation'})) %} {% set content = render_var(url('system.admin_content')) %} <h2>{% trans %}Goal{% endtrans %}</h2> <p>{% trans %}Change the workflow state of a particular entity. See {{ workflows_overview_topic }} for an overview of workflows, and {{ content_structure_topic }} for an overview of content entities.{% endtrans %}</p> diff --git a/core/modules/help_topics/help_topics/content_moderation.configuring_workflows.html.twig b/core/modules/help_topics/help_topics/content_moderation.configuring_workflows.html.twig index 35f3bce72f44..84074a866563 100644 --- a/core/modules/help_topics/help_topics/content_moderation.configuring_workflows.html.twig +++ b/core/modules/help_topics/help_topics/content_moderation.configuring_workflows.html.twig @@ -10,8 +10,8 @@ related: {% set user_overview_topic = render_var(help_topic_link('user.overview')) %} {% set user_permissions_topic = render_var(help_topic_link('user.permissions')) %} {% set workflows_overview_topic = render_var(help_topic_link('workflows.overview')) %} -{% set content_moderation_permissions = render_var(url('user.admin_permissions', {}, {'fragment': 'module-content_moderation'})) %} -{% set workflows_permissions = render_var(url('user.admin_permissions', {}, {'fragment': 'module-workflows'})) %} +{% set content_moderation_permissions = render_var(url('user.admin_permissions.module', {'modules': 'content_moderation'})) %} +{% set workflows_permissions = render_var(url('user.admin_permissions.module', {'modules': 'workflows'})) %} {% set workflows_url = render_var(url('entity.workflow.collection')) %} <h2>{% trans %}Goal{% endtrans %}</h2> <p>{% trans %}Create or edit a workflow with various workflow states (for example <em>Concept</em>, <em>Archived</em>, etc.) for moderating content. See {{ workflows_overview_topic }} for more information on workflows.{% endtrans %}</p> diff --git a/core/modules/help_topics/help_topics/node.creating_content.html.twig b/core/modules/help_topics/help_topics/node.creating_content.html.twig index ea28358ebb75..dd365d40ab6c 100644 --- a/core/modules/help_topics/help_topics/node.creating_content.html.twig +++ b/core/modules/help_topics/help_topics/node.creating_content.html.twig @@ -12,7 +12,7 @@ related: {% set content_permissions_link_text %} {% trans %}Access the Content overview page{% endtrans %} {% endset %} -{% set content_permissions_link = render_var(help_route_link(content_permissions_link_text, 'user.admin_permissions', {}, {'fragment': 'module-node'})) %} +{% set content_permissions_link = render_var(help_route_link(content_permissions_link_text, 'user.admin_permissions.module', {'modules': 'node'})) %} {% set content_overview_topic = render_var(help_topic_link('node.overview')) %} <h2>{% trans %}Goal{% endtrans %}</h2> <p>{% trans %}Create and publish a content item. See {{ content_overview_topic }} for more about content types and content items.{% endtrans %}</p> diff --git a/core/modules/help_topics/help_topics/node.creating_type.html.twig b/core/modules/help_topics/help_topics/node.creating_type.html.twig index 424b9c8f5f44..cb1fa63e1c7f 100644 --- a/core/modules/help_topics/help_topics/node.creating_type.html.twig +++ b/core/modules/help_topics/help_topics/node.creating_type.html.twig @@ -10,7 +10,7 @@ related: {% set content_permissions_link_text %} {% trans %}Administer content types{% endtrans %} {% endset %} -{% set content_permissions_link = render_var(help_route_link(content_permissions_link_text, 'user.admin_permissions', {}, {'fragment': 'module-node'})) %} +{% set content_permissions_link = render_var(help_route_link(content_permissions_link_text, 'user.admin_permissions.module', {'modules': 'node'})) %} {% set content_types_link_text %} {% trans %}Content types{% endtrans %} {% endset %} diff --git a/core/modules/help_topics/help_topics/node.editing.html.twig b/core/modules/help_topics/help_topics/node.editing.html.twig index 2c0351aa0df2..e56830b93640 100644 --- a/core/modules/help_topics/help_topics/node.editing.html.twig +++ b/core/modules/help_topics/help_topics/node.editing.html.twig @@ -11,7 +11,7 @@ related: {% set content_permissions_link_text %} {% trans %}Access the Content overview page{% endtrans %} {% endset %} -{% set content_permissions_link = render_var(help_route_link(content_permissions_link_text, 'user.admin_permissions', {}, {'fragment': 'module-node'})) %} +{% set content_permissions_link = render_var(help_route_link(content_permissions_link_text, 'user.admin_permissions.module', {'modules': 'node'})) %} {% set node_overview_topic = render_var(help_topic_link('node.overview')) %} <h2>{% trans %}Goal{% endtrans %}</h2> <p>{% trans %}Find a content item and edit it, or update a group of content items in bulk. See {{ node_overview_topic }} for more about content types and content items.{% endtrans %}</p> diff --git a/core/modules/help_topics/help_topics/path.creating_alias.html.twig b/core/modules/help_topics/help_topics/path.creating_alias.html.twig index 28162d2e4982..418bc2040030 100644 --- a/core/modules/help_topics/help_topics/path.creating_alias.html.twig +++ b/core/modules/help_topics/help_topics/path.creating_alias.html.twig @@ -9,7 +9,7 @@ related: {% set path_permissions_link_text %} {% trans %}Create and edit URL aliases{% endtrans %} {% endset %} -{% set path_permissions_link = render_var(help_route_link(path_permissions_link_text, 'user.admin_permissions', {}, {'fragment': 'module-path'})) %} +{% set path_permissions_link = render_var(help_route_link(path_permissions_link_text, 'user.admin_permissions.module', {'modules': 'path'})) %} {% set overview_topic = render_var(help_topic_link('path.overview')) %} <h2>{% trans %}Goal{% endtrans %}</h2> <p>{% trans %}Give a content item page a human- or SEO-friendly URL alias; you can follow similar steps to create an alias for a taxonomy term page. See {{ overview_topic }} for more about aliases.{% endtrans %}</p> diff --git a/core/modules/help_topics/help_topics/path.editing_alias.html.twig b/core/modules/help_topics/help_topics/path.editing_alias.html.twig index 518525bed80d..9e0e1b485591 100644 --- a/core/modules/help_topics/help_topics/path.editing_alias.html.twig +++ b/core/modules/help_topics/help_topics/path.editing_alias.html.twig @@ -7,7 +7,7 @@ related: {% set path_permissions_link_text %} {% trans %}Administer URL aliases{% endtrans %} {% endset %} -{% set path_permissions_link = render_var(help_route_link(path_permissions_link_text, 'user.admin_permissions', {}, {'fragment': 'module-path'})) %} +{% set path_permissions_link = render_var(help_route_link(path_permissions_link_text, 'user.admin_permissions.module', {'modules': 'path'})) %} {% set path_aliases_link_text %} {% trans %}URL aliases{% endtrans %} {% endset %} diff --git a/core/modules/help_topics/help_topics/taxonomy.configuring.html.twig b/core/modules/help_topics/help_topics/taxonomy.configuring.html.twig index aa032f3d79c8..d1906b5b547c 100644 --- a/core/modules/help_topics/help_topics/taxonomy.configuring.html.twig +++ b/core/modules/help_topics/help_topics/taxonomy.configuring.html.twig @@ -9,7 +9,7 @@ related: {% set taxonomy_permissions_link_text %} {% trans %}Administer vocabularies and terms{% endtrans %} {% endset %} -{% set taxonomy_permissions_link = render_var(help_route_link(taxonomy_permissions_link_text, 'user.admin_permissions', {}, {'fragment': 'module-taxonomy'})) %} +{% set taxonomy_permissions_link = render_var(help_route_link(taxonomy_permissions_link_text, 'user.admin_permissions.module', {'modules': 'taxonomy'})) %} {% set taxonomy_admin_link_text %} {% trans %}Taxonomy{% endtrans %} {% endset %} diff --git a/core/modules/help_topics/help_topics/views_ui.bulk_operations.html.twig b/core/modules/help_topics/help_topics/views_ui.bulk_operations.html.twig index 2ccf9af4fe68..65043176efbb 100644 --- a/core/modules/help_topics/help_topics/views_ui.bulk_operations.html.twig +++ b/core/modules/help_topics/help_topics/views_ui.bulk_operations.html.twig @@ -14,7 +14,7 @@ related: {% set views_permissions_link_text %} {% trans %}Administer views{% endtrans %} {% endset %} -{% set views_permissions = render_var(help_route_link(views_permissions_link_text, 'user.admin_permissions', {}, {'fragment': 'module-views_ui'})) %} +{% set views_permissions = render_var(help_route_link(views_permissions_link_text, 'user.admin_permissions.module', {'modules': 'views_ui'})) %} <h2>{% trans %}Goal{% endtrans %}</h2> <p>{% trans %}Add one or more existing actions as bulk operations to an existing table-style view. If you have the core Actions module installed, see the related topic "Configuring actions" for more information about actions.{% endtrans %}</p> <h2>{% trans %}Who can edit views?{% endtrans %}</h2> diff --git a/core/modules/layout_builder/layout_builder.module b/core/modules/layout_builder/layout_builder.module index 4553f0cada2f..cc849733e362 100644 --- a/core/modules/layout_builder/layout_builder.module +++ b/core/modules/layout_builder/layout_builder.module @@ -58,7 +58,7 @@ function layout_builder_help($route_name, RouteMatchInterface $route_match) { $output .= '<dd>' . t('If enabled, each individual content item can have a custom layout. Once the layout for an individual content item is overridden, changes to the Default layout will no longer affect it. Overridden layouts may be reverted to return to matching and being synchronized to their Default layout.') . '</dd>'; $output .= '<dt>' . t('User permissions') . '</dt>'; $output .= '<dd>' . t('The Layout Builder module makes a number of permissions available, which can be set by role on the <a href=":permissions">permissions page</a>. For more information, see the <a href=":layout-builder-permissions">Configuring Layout Builder permissions</a> online documentation.', [ - ':permissions' => Url::fromRoute('user.admin_permissions', [], ['fragment' => 'module-layout_builder'])->toString(), + ':permissions' => Url::fromRoute('user.admin_permissions.module', ['modules' => 'layout_builder'])->toString(), ':layout-builder-permissions' => 'https://www.drupal.org/docs/8/core/modules/layout-builder/configuring-layout-builder-permissions', ]) . '</dd>'; $output .= '</dl>'; diff --git a/core/modules/media/media.module b/core/modules/media/media.module index 8c90b3bfff7b..0dc9bd20a771 100644 --- a/core/modules/media/media.module +++ b/core/modules/media/media.module @@ -44,7 +44,7 @@ function media_help($route_name, RouteMatchInterface $route_match) { $output .= '<dd>' . t('The Media module also enables you to create multiple versions of any media item, and revert to older versions using the <em>Revision information</em> settings.') . '</dd>'; $output .= '<dt>' . t('User permissions') . '</dt>'; $output .= '<dd>' . t('The Media module makes a number of permissions available, which can be set by role on the <a href=":permissions">permissions page</a>.', [ - ':permissions' => Url::fromRoute('user.admin_permissions', [], ['fragment' => 'module-media'])->toString(), + ':permissions' => Url::fromRoute('user.admin_permissions.module', ['modules' => 'media'])->toString(), ]) . '</dd>'; $output .= '<dt>' . t('Adding media to other content') . '</dt>'; $output .= '<dd>' . t('Users with permission to administer content types can add media support by adding a media reference field to the content type on the content type administration page. (The same is true of block types, taxonomy terms, user profiles, and other content that supports fields.) A media reference field can refer to any configured media type. It is possible to allow multiple media types in the same field.') . '</dd>'; diff --git a/core/modules/node/node.module b/core/modules/node/node.module index a09512492dc3..cc32fef1376a 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -67,7 +67,7 @@ function node_help($route_name, RouteMatchInterface $route_match) { $output .= '<dt>' . t('Creating revisions') . '</dt>'; $output .= '<dd>' . t('The Node module also enables you to create multiple versions of any content, and revert to older versions using the <em>Revision information</em> settings.') . '</dd>'; $output .= '<dt>' . t('User permissions') . '</dt>'; - $output .= '<dd>' . t('The Node module makes a number of permissions available for each content type, which can be set by role on the <a href=":permissions">permissions page</a>.', [':permissions' => Url::fromRoute('user.admin_permissions', [], ['fragment' => 'module-node'])->toString()]) . '</dd>'; + $output .= '<dd>' . t('The Node module makes a number of permissions available for each content type, which can be set by role on the <a href=":permissions">permissions page</a>.', [':permissions' => Url::fromRoute('user.admin_permissions.module', ['modules' => 'node'])->toString()]) . '</dd>'; $output .= '</dl>'; return $output; diff --git a/core/modules/path/path.module b/core/modules/path/path.module index 55c5cbfc40de..70c2282ce04b 100644 --- a/core/modules/path/path.module +++ b/core/modules/path/path.module @@ -29,7 +29,7 @@ function path_help($route_name, RouteMatchInterface $route_match) { $output .= '<h3>' . t('Uses') . '</h3>'; $output .= '<dl>'; $output .= '<dt>' . t('Creating aliases') . '</dt>'; - $output .= '<dd>' . t('If you create or edit a taxonomy term you can add an alias (for example <em>music/jazz</em>) in the field "URL alias". When creating or editing content you can add an alias (for example <em>about-us/team</em>) under the section "URL path settings" in the field "URL alias". Aliases for any other path can be added through the page <a href=":aliases">URL aliases</a>. To add aliases a user needs the permission <a href=":permissions">Create and edit URL aliases</a>.', [':aliases' => Url::fromRoute('entity.path_alias.collection')->toString(), ':permissions' => Url::fromRoute('user.admin_permissions', [], ['fragment' => 'module-path'])->toString()]) . '</dd>'; + $output .= '<dd>' . t('If you create or edit a taxonomy term you can add an alias (for example <em>music/jazz</em>) in the field "URL alias". When creating or editing content you can add an alias (for example <em>about-us/team</em>) under the section "URL path settings" in the field "URL alias". Aliases for any other path can be added through the page <a href=":aliases">URL aliases</a>. To add aliases a user needs the permission <a href=":permissions">Create and edit URL aliases</a>.', [':aliases' => Url::fromRoute('entity.path_alias.collection')->toString(), ':permissions' => Url::fromRoute('user.admin_permissions.module', ['modules' => 'path'])->toString()]) . '</dd>'; $output .= '<dt>' . t('Managing aliases') . '</dt>'; $output .= '<dd>' . t('The Path module provides a way to search and view a <a href=":aliases">list of all aliases</a> that are in use on your website. Aliases can be added, edited and deleted through this list.', [':aliases' => Url::fromRoute('entity.path_alias.collection')->toString()]) . '</dd>'; $output .= '</dl>'; diff --git a/core/modules/quickedit/quickedit.module b/core/modules/quickedit/quickedit.module index 07a759d3a39d..1a86f979c3e2 100644 --- a/core/modules/quickedit/quickedit.module +++ b/core/modules/quickedit/quickedit.module @@ -24,7 +24,7 @@ function quickedit_help($route_name, RouteMatchInterface $route_match) { switch ($route_name) { case 'help.page.quickedit': $output = '<h3>' . t('About') . '</h3>'; - $output .= '<p>' . t('The Quick Edit module allows users with the <a href=":quickedit_permission">Access in-place editing</a> and <a href=":contextual_permission">Use contextual links</a> permissions to edit field content without visiting a separate page. For more information, see the <a href=":handbook_url">online documentation for the Quick Edit module</a>.', [':handbook_url' => 'https://www.drupal.org/documentation/modules/edit', ':quickedit_permission' => Url::fromRoute('user.admin_permissions', [], ['fragment' => 'module-quickedit'])->toString(), ':contextual_permission' => Url::fromRoute('user.admin_permissions', [], ['fragment' => 'module-contextual'])->toString()]) . '</p>'; + $output .= '<p>' . t('The Quick Edit module allows users with the <a href=":quickedit_permission">Access in-place editing</a> and <a href=":contextual_permission">Use contextual links</a> permissions to edit field content without visiting a separate page. For more information, see the <a href=":handbook_url">online documentation for the Quick Edit module</a>.', [':handbook_url' => 'https://www.drupal.org/documentation/modules/edit', ':quickedit_permission' => Url::fromRoute('user.admin_permissions.module', ['modules' => 'quickedit'])->toString(), ':contextual_permission' => Url::fromRoute('user.admin_permissions.module', ['modules' => 'contextual'])->toString()]) . '</p>'; $output .= '<h3>' . t('Uses') . '</h3>'; $output .= '<dl>'; $output .= '<dt>' . t('Editing content in-place') . '</dt>'; diff --git a/core/modules/search/search.module b/core/modules/search/search.module index 747efa796e8e..87e743322427 100644 --- a/core/modules/search/search.module +++ b/core/modules/search/search.module @@ -70,9 +70,9 @@ function search_help($route_name, RouteMatchInterface $route_match) { $output .= '<dd>' . t('Some search page plugins, such as the core Content search page, index searchable text using the Drupal core search index, and will not work unless content is indexed. Indexing is done during <em>cron</em> runs, so it requires a <a href=":cron">cron maintenance task</a> to be set up. There are also several settings affecting indexing that can be configured on the <a href=":search-settings">Search pages page</a>: the number of items to index per cron run, the minimum word length to index, and how to handle Chinese, Japanese, and Korean characters.', [':cron' => Url::fromRoute('system.cron_settings')->toString(), ':search-settings' => Url::fromRoute('entity.search_page.collection')->toString()]) . '</dd>'; $output .= '<dd>' . t('Modules providing search page plugins generally ensure that content-related actions on your site (creating, editing, or deleting content and comments) automatically cause affected content items to be marked for indexing or reindexing at the next cron run. When content is marked for reindexing, the previous content remains in the index until cron runs, at which time it is replaced by the new content. However, there are some actions related to the structure of your site that do not cause affected content to be marked for reindexing. Examples of structure-related actions that affect content include deleting or editing taxonomy terms, enabling or disabling modules that add text to content (such as Taxonomy, Comment, and field-providing modules), and modifying the fields or display parameters of your content types. If you take one of these actions and you want to ensure that the search index is updated to reflect your changed site structure, you can mark all content for reindexing by clicking the "Re-index site" button on the <a href=":search-settings">Search pages page</a>. If you have a lot of content on your site, it may take several cron runs for the content to be reindexed.', [':search-settings' => Url::fromRoute('entity.search_page.collection')->toString()]) . '</dd>'; $output .= '<dt>' . t('Displaying the Search block') . '</dt>'; - $output .= '<dd>' . t('The Search module includes a block, which can be enabled and configured on the <a href=":blocks">Block layout page</a>, if you have the Block module enabled; the default block title is Search, and it is the Search form block in the Forms category, if you wish to add another instance. The block is available to users with the <a href=":search_permission">Use search</a> permission, and it performs a search using the configured default search page.', [':blocks' => (\Drupal::moduleHandler()->moduleExists('block')) ? Url::fromRoute('block.admin_display')->toString() : '#', ':search_permission' => Url::fromRoute('user.admin_permissions', [], ['fragment' => 'module-search'])->toString()]) . '</dd>'; + $output .= '<dd>' . t('The Search module includes a block, which can be enabled and configured on the <a href=":blocks">Block layout page</a>, if you have the Block module enabled; the default block title is Search, and it is the Search form block in the Forms category, if you wish to add another instance. The block is available to users with the <a href=":search_permission">Use search</a> permission, and it performs a search using the configured default search page.', [':blocks' => (\Drupal::moduleHandler()->moduleExists('block')) ? Url::fromRoute('block.admin_display')->toString() : '#', ':search_permission' => Url::fromRoute('user.admin_permissions.module', ['modules' => 'search'])->toString()]) . '</dd>'; $output .= '<dt>' . t('Searching your site') . '</dt>'; - $output .= '<dd>' . t('Users with <a href=":search_permission">Use search</a> permission can use the Search block and <a href=":search">Search page</a>. Users with the <a href=":node_permission">View published content</a> permission can use configured search pages of type <em>Content</em> to search for content containing exact keywords; in addition, users with <a href=":search_permission">Use advanced search</a> permission can use more complex search filtering. Users with the <a href=":user_permission">View user information</a> permission can use configured search pages of type <em>Users</em> to search for active users containing the keyword anywhere in the username, and users with the <a href=":user_permission">Administer users</a> permission can search for active and blocked users, by email address or username keyword.', [':search' => Url::fromRoute('search.view')->toString(), ':search_permission' => Url::fromRoute('user.admin_permissions', [], ['fragment' => 'module-search'])->toString(), ':node_permission' => Url::fromRoute('user.admin_permissions', [], ['fragment' => 'module-node'])->toString(), ':user_permission' => Url::fromRoute('user.admin_permissions', [], ['fragment' => 'module-user'])->toString()]) . '</dd>'; + $output .= '<dd>' . t('Users with <a href=":search_permission">Use search</a> permission can use the Search block and <a href=":search">Search page</a>. Users with the <a href=":node_permission">View published content</a> permission can use configured search pages of type <em>Content</em> to search for content containing exact keywords; in addition, users with <a href=":search_permission">Use advanced search</a> permission can use more complex search filtering. Users with the <a href=":user_permission">View user information</a> permission can use configured search pages of type <em>Users</em> to search for active users containing the keyword anywhere in the username, and users with the <a href=":user_permission">Administer users</a> permission can search for active and blocked users, by email address or username keyword.', [':search' => Url::fromRoute('search.view')->toString(), ':search_permission' => Url::fromRoute('user.admin_permissions.module', ['modules' => 'search'])->toString(), ':node_permission' => Url::fromRoute('user.admin_permissions.module', ['modules' => 'node'])->toString(), ':user_permission' => Url::fromRoute('user.admin_permissions.module', ['modules' => 'user'])->toString()]) . '</dd>'; $output .= '<dt>' . t('Extending the Search module') . '</dt>'; $output .= '<dd>' . t('By default, the Search module only supports exact keyword matching in content searches. You can modify this behavior by installing a language-specific stemming module for your language (such as <a href=":porterstemmer_url">Porter Stemmer</a> for American English), which allows words such as walk, walking, and walked to be matched in the Search module. Another approach is to use a third-party search technology with stemming or partial word matching features built in, such as <a href=":solr_url">Apache Solr</a> or <a href=":sphinx_url">Sphinx</a>. There are also contributed modules that provide additional search pages. These and other <a href=":contrib-search">search-related contributed modules</a> can be downloaded by visiting Drupal.org.', [':contrib-search' => 'https://www.drupal.org/project/project_module?f[2]=im_vid_3%3A105', ':porterstemmer_url' => 'https://www.drupal.org/project/porterstemmer', ':solr_url' => 'https://www.drupal.org/project/apachesolr', ':sphinx_url' => 'https://www.drupal.org/project/sphinx']) . '</dd>'; $output .= '</dl>'; diff --git a/core/modules/settings_tray/settings_tray.module b/core/modules/settings_tray/settings_tray.module index 2004d943bf45..e16c213f267f 100644 --- a/core/modules/settings_tray/settings_tray.module +++ b/core/modules/settings_tray/settings_tray.module @@ -19,7 +19,7 @@ function settings_tray_help($route_name, RouteMatchInterface $route_match) { switch ($route_name) { case 'help.page.settings_tray': $output = '<h3>' . t('About') . '</h3>'; - $output .= '<p>' . t('The Settings Tray module allows users with the <a href=":administer_block_permission">Administer blocks</a> and <a href=":contextual_permission">Use contextual links</a> permissions to edit blocks without visiting a separate page. For more information, see the <a href=":handbook_url">online documentation for the Settings Tray module</a>.', [':handbook_url' => 'https://www.drupal.org/documentation/modules/settings_tray', ':administer_block_permission' => Url::fromRoute('user.admin_permissions', [], ['fragment' => 'module-block'])->toString(), ':contextual_permission' => Url::fromRoute('user.admin_permissions', [], ['fragment' => 'module-contextual'])->toString()]) . '</p>'; + $output .= '<p>' . t('The Settings Tray module allows users with the <a href=":administer_block_permission">Administer blocks</a> and <a href=":contextual_permission">Use contextual links</a> permissions to edit blocks without visiting a separate page. For more information, see the <a href=":handbook_url">online documentation for the Settings Tray module</a>.', [':handbook_url' => 'https://www.drupal.org/documentation/modules/settings_tray', ':administer_block_permission' => Url::fromRoute('user.admin_permissions.module', ['modules' => 'block'])->toString(), ':contextual_permission' => Url::fromRoute('user.admin_permissions.module', ['modules' => 'contextual'])->toString()]) . '</p>'; $output .= '<h3>' . t('Uses') . '</h3>'; $output .= '<dl>'; $output .= '<dt>' . t('Editing blocks in place') . '</dt>'; diff --git a/core/modules/statistics/statistics.module b/core/modules/statistics/statistics.module index 40066c611f25..6f207b4dc4b2 100644 --- a/core/modules/statistics/statistics.module +++ b/core/modules/statistics/statistics.module @@ -25,7 +25,7 @@ function statistics_help($route_name, RouteMatchInterface $route_match) { $output .= '<dt>' . t('Displaying popular content') . '</dt>'; $output .= '<dd>' . t('The module includes a <em>Popular content</em> block that displays the most viewed pages today and for all time, and the last content viewed. To use the block, enable <em>Count content views</em> on the <a href=":statistics-settings">Statistics page</a>, and then you can enable and configure the block on the <a href=":blocks">Block layout page</a>.', [':statistics-settings' => Url::fromRoute('statistics.settings')->toString(), ':blocks' => (\Drupal::moduleHandler()->moduleExists('block')) ? Url::fromRoute('block.admin_display')->toString() : '#']) . '</dd>'; $output .= '<dt>' . t('Page view counter') . '</dt>'; - $output .= '<dd>' . t('The Statistics module includes a counter for each page that increases whenever the page is viewed. To use the counter, enable <em>Count content views</em> on the <a href=":statistics-settings">Statistics page</a>, and set the necessary <a href=":permissions">permissions</a> (<em>View content hits</em>) so that the counter is visible to the users.', [':statistics-settings' => Url::fromRoute('statistics.settings')->toString(), ':permissions' => Url::fromRoute('user.admin_permissions', [], ['fragment' => 'module-statistics'])->toString()]) . '</dd>'; + $output .= '<dd>' . t('The Statistics module includes a counter for each page that increases whenever the page is viewed. To use the counter, enable <em>Count content views</em> on the <a href=":statistics-settings">Statistics page</a>, and set the necessary <a href=":permissions">permissions</a> (<em>View content hits</em>) so that the counter is visible to the users.', [':statistics-settings' => Url::fromRoute('statistics.settings')->toString(), ':permissions' => Url::fromRoute('user.admin_permissions.module', ['modules' => 'statistics'])->toString()]) . '</dd>'; $output .= '</dl>'; return $output; diff --git a/core/modules/system/system.module b/core/modules/system/system.module index bb91e01716bc..69f75fa0fcbd 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -1024,10 +1024,9 @@ function system_get_module_admin_tasks($module, array $info) { if ($permission_handler->moduleProvidesPermissions($module)) { /** @var \Drupal\Core\Access\AccessManagerInterface $access_manager */ $access_manager = \Drupal::service('access_manager'); - if ($access_manager->checkNamedRoute('user.admin_permissions', [], \Drupal::currentUser())) { + if ($access_manager->checkNamedRoute('user.admin_permissions.module', ['modules' => $module], \Drupal::currentUser())) { /** @var \Drupal\Core\Url $url */ - $url = new Url('user.admin_permissions'); - $url->setOption('fragment', 'module-' . $module); + $url = new Url('user.admin_permissions.module', ['modules' => $module]); $admin_tasks["user.admin_permissions.$module"] = [ 'title' => t('Configure @module permissions', ['@module' => $info['name']]), 'description' => '', diff --git a/core/modules/system/tests/src/Functional/System/AdminTest.php b/core/modules/system/tests/src/Functional/System/AdminTest.php index bf036e55d67f..07cd6fa16f94 100644 --- a/core/modules/system/tests/src/Functional/System/AdminTest.php +++ b/core/modules/system/tests/src/Functional/System/AdminTest.php @@ -96,7 +96,7 @@ public function testAdminPages() { // On admin/index only, the administrator should also see a "Configure // permissions" link for the Locale module. if ($page == 'admin/index') { - $this->assertSession()->linkByHrefExists("admin/people/permissions#module-locale"); + $this->assertSession()->linkByHrefExists("admin/people/permissions/module/locale"); } // For a less privileged user, verify that there are no links to Locale's diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index 93763d36c5a6..e51e4358bc07 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -22,7 +22,7 @@ function taxonomy_help($route_name, RouteMatchInterface $route_match) { $field_ui_url = \Drupal::moduleHandler()->moduleExists('field_ui') ? Url::fromRoute('help.page', ['name' => 'field_ui'])->toString() : '#'; $output = ''; $output .= '<h3>' . t('About') . '</h3>'; - $output .= '<p>' . t('The Taxonomy module allows users who have permission to create and edit content to categorize (tag) content of that type. Users who have the <em>Administer vocabularies and terms</em> <a href=":permissions" title="Taxonomy module permissions">permission</a> can add <em>vocabularies</em> that contain a set of related <em>terms</em>. The terms in a vocabulary can either be pre-set by an administrator or built gradually as content is added and edited. Terms may be organized hierarchically if desired.', [':permissions' => Url::fromRoute('user.admin_permissions', [], ['fragment' => 'module-taxonomy'])->toString()]) . '</p>'; + $output .= '<p>' . t('The Taxonomy module allows users who have permission to create and edit content to categorize (tag) content of that type. Users who have the <em>Administer vocabularies and terms</em> <a href=":permissions" title="Taxonomy module permissions">permission</a> can add <em>vocabularies</em> that contain a set of related <em>terms</em>. The terms in a vocabulary can either be pre-set by an administrator or built gradually as content is added and edited. Terms may be organized hierarchically if desired.', [':permissions' => Url::fromRoute('user.admin_permissions.module', ['modules' => 'taxonomy'])->toString()]) . '</p>'; $output .= '<p>' . t('For more information, see the <a href=":taxonomy">online documentation for the Taxonomy module</a>.', [':taxonomy' => 'https://www.drupal.org/documentation/modules/taxonomy/']) . '</p>'; $output .= '<h3>' . t('Uses') . '</h3>'; $output .= '<dl>'; -- GitLab