diff --git a/core/modules/help_topics/config/install/filter.format.help.yml b/core/modules/help_topics/config/install/filter.format.help.yml deleted file mode 100644 index ad488715ea..0000000000 --- a/core/modules/help_topics/config/install/filter.format.help.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - enforced: - module: - - help_topics -name: Help -format: help -weight: 0 -filters: - filter_html: - id: filter_html - provider: filter - status: true - weight: -10 - settings: - allowed_html: '

    1.   '
      -      filter_html_help: true
      -      filter_html_nofollow: false
      diff --git a/core/modules/help_topics/help_topics.info.yml b/core/modules/help_topics/help_topics.info.yml
      index 57e822d327..3afdacc432 100644
      --- a/core/modules/help_topics/help_topics.info.yml
      +++ b/core/modules/help_topics/help_topics.info.yml
      @@ -6,4 +6,3 @@ package: Core (Experimental)
       version: VERSION
       dependencies:
         - drupal:help
      -  - drupal:filter
      diff --git a/core/modules/help_topics/help_topics.module b/core/modules/help_topics/help_topics.module
      index 7ed6701e05..9ec6d21335 100644
      --- a/core/modules/help_topics/help_topics.module
      +++ b/core/modules/help_topics/help_topics.module
      @@ -40,9 +40,9 @@ function help_topics_help($route_name, RouteMatchInterface $route_match) {
        * Implements hook_theme().
        */
       function help_topics_theme($existing, $type, $theme, $path) {
      -  $twigPlugins = array_keys(array_filter(\Drupal::service('plugin.manager.help_topic')->getDefinitions(), function (array $definition) {
      +  $twigPlugins = array_filter(\Drupal::service('plugin.manager.help_topic')->getDefinitions(), function (array $definition) {
           return $definition['class'] === HelpTopicTwig::class;
      -  }));
      +  });
         $return = [
           'help_topic' => [
             'variables' => [
      @@ -51,9 +51,12 @@ function help_topics_theme($existing, $type, $theme, $path) {
             ],
           ],
         ];
      -  foreach ($twigPlugins as $pluginId) {
      -    $return[HelpTopicTwig::getThemeHook($pluginId)] = [
      +  foreach ($twigPlugins as $pluginId => $definition) {
      +    $hook = HelpTopicTwig::getThemeHook($pluginId);
      +    $return[$hook] = [
             'variables' => [],
      +      'path' => drupal_get_path('module', $definition['provider']) . '/help_topics/templates',
      +      'template' => strtr($hook, '_', '-'),
           ];
         }
         return $return;
      diff --git a/core/modules/help_topics/help_topics.tokens.inc b/core/modules/help_topics/help_topics.tokens.inc
      index 4005e78197..979e369acc 100644
      --- a/core/modules/help_topics/help_topics.tokens.inc
      +++ b/core/modules/help_topics/help_topics.tokens.inc
      @@ -12,17 +12,6 @@
        * Implements hook_token_info().
        */
       function help_topics_token_info() {
      -  $types['route'] = [
      -    'name' => t("Route information"),
      -    'description' => t("Tokens based on route names."),
      -  ];
      -
      -  $routes = [];
      -  $routes['url'] = [
      -    'name' => t('URL'),
      -    'description' => t('The URL to the route. Provide the route name as route:url:ROUTE_NAME'),
      -  ];
      -
         $types['help_topic'] = [
           'name' => t("Help Topics"),
           'description' => t("Tokens for help topics."),
      @@ -38,7 +27,6 @@ function help_topics_token_info() {
           'types' => $types,
           'tokens' => [
             'help_topic' => $topics,
      -      'route' => $routes,
           ],
         ];
       }
      @@ -76,20 +64,6 @@ function help_topics_tokens($type, $tokens, array $data, array $options, Bubblea
             }
           }
         }
      -  elseif ($type == 'route') {
      -    $routes = $token_service->findWithPrefix($tokens, 'url');
      -    foreach ($routes as $route_name => $original) {
      -      try {
      -        $url = Url::fromRoute($route_name, [], $url_options)->toString(TRUE);
      -        $replacements[$original] = $url->getGeneratedUrl();
      -        $bubbleable_metadata->addCacheableDependency($url);
      -      }
      -      catch (\Exception $e) {
      -        // Invalid route or missing parameters or something like that.
      -        // Do nothing.
      -      }
      -    }
      -  }
       
         return $replacements;
       }
      diff --git a/core/modules/help_topics/help_topics/config_error.help_topic.yml b/core/modules/help_topics/help_topics/config_error.help_topic.yml
      index 19edb43d5f..6317dfbb7f 100644
      --- a/core/modules/help_topics/help_topics/config_error.help_topic.yml
      +++ b/core/modules/help_topics/help_topics/config_error.help_topic.yml
      @@ -9,29 +9,3 @@ list_on:
         - maintenance
         - menu_overview
         - security
      -body:
      -  -
      -    text: 'Configuring 403/404 pages'
      -    prefix_tags: '

      ' - suffix_tags: '

      ' - - - text: 'The core software provides default responses for 403 response (Not Authorized: when someone tries to visit a page they do not have permission to see) and 404 response (Not Found: when someone tries to visit a page that does not exist). You can change what page is displayed for these responses on the Basic site settings page, which you can reach in the main Manage administrative menu, by navigating to Configuration > System > Basic site settings. Note that the pages you want to use must already exist as either system-provided pages or content that you have created.' - prefix_tags: '

      ' - suffix_tags: '

      ' - - - text: 'Responding to software errors' - prefix_tags: '

      ' - suffix_tags: '

      ' - - - text: 'Software errors on your site are logged, if you have a logging module installed (such as the core Database Logging module or the core Syslog module). You can configure whether or not error messages are also shown (to both administrators and other site visitors) on the Logging and errors configuration page, which you can reach in the main Manage administrative menu, by navigating to Configuration > Development > Logging and errors.' - prefix_tags: '

      ' - suffix_tags: '

      ' - - - text: 'Viewing the site log' - prefix_tags: '

      ' - suffix_tags: '

      ' - - - text: 'If you have the core Database Logging module installed, you can view recent error and informational messages by navigating in the main Manage administrative menu to Reports > Recent log messages. If you are using the core Syslog module for logging, error messages will be logged in your web server''s log files.' - prefix_tags: '

      ' - suffix_tags: '

      ' -body_format: help diff --git a/core/modules/help_topics/help_topics/help_topic_writing.help_topic.yml b/core/modules/help_topics/help_topics/help_topic_writing.help_topic.yml index bd098e65ad..04d972821a 100644 --- a/core/modules/help_topics/help_topics/help_topic_writing.help_topic.yml +++ b/core/modules/help_topics/help_topics/help_topic_writing.help_topic.yml @@ -3,25 +3,3 @@ label: 'Writing good help' top_level: true related: { } list_on: { } -body: - - - text: 'Here are some suggestions for how to make your help topics as useful as possible for readers:' - prefix_tags: '

      ' - suffix_tags: '

      ' - - - text: 'Choose short titles. If the topic describes a task, start with a verb in -ing form, like "Writing good help".' - prefix_tags: '
      • ' - suffix_tags: '
      • ' - - - text: 'Make your topics modular and short, using links to connect information together.' - prefix_tags: '
      • ' - suffix_tags: '
      • ' - - - text: 'Use headings and lists to organize your topics.' - prefix_tags: '
      • ' - suffix_tags: '
      • ' - - - text: 'Write in second person (you, your). When describing a task, use imperative mood (tell people directly what to do, such as "Enter information in the ABC field", rather than using words like "please" or more passive or declarative language like "the ABC field needs to be filled in").' - prefix_tags: '
      • ' - suffix_tags: '
      ' -body_format: help diff --git a/core/modules/help_topics/help_topics/maintenance.help_topic.yml b/core/modules/help_topics/help_topics/maintenance.help_topic.yml index 1f435a840e..1aee4e0128 100644 --- a/core/modules/help_topics/help_topics/maintenance.help_topic.yml +++ b/core/modules/help_topics/help_topics/maintenance.help_topic.yml @@ -3,9 +3,3 @@ label: 'Maintaining and troubleshooting your site' top_level: true related: { } list_on: { } -body: - - - text: 'The related topics listed here will help you keep your site running and troubleshoot problems.' - prefix_tags: '

      ' - suffix_tags: '

      ' -body_format: help diff --git a/core/modules/help_topics/help_topics/menu_overview.help_topic.yml b/core/modules/help_topics/help_topics/menu_overview.help_topic.yml new file mode 100644 index 0000000000..fbc3bd3ebf --- /dev/null +++ b/core/modules/help_topics/help_topics/menu_overview.help_topic.yml @@ -0,0 +1,5 @@ +id: menu_overview +label: 'Defining navigation and URLs' +top_level: true +related: { } +list_on: { } diff --git a/core/modules/help_topics/help_topics/menu_overview.help_topics.yml b/core/modules/help_topics/help_topics/menu_overview.help_topics.yml deleted file mode 100644 index 1a48f2968c..0000000000 --- a/core/modules/help_topics/help_topics/menu_overview.help_topics.yml +++ /dev/null @@ -1,11 +0,0 @@ -id: menu_overview -label: 'Defining navigation and URLs' -top_level: true -related: { } -list_on: { } -body: - - - text: 'The related topics listed here describe how to set up various aspects of site navigation and URLs.' - prefix_tags: '

      ' - suffix_tags: '

      ' -body_format: help diff --git a/core/modules/help_topics/help_topics/security.help_topic.yml b/core/modules/help_topics/help_topics/security.help_topic.yml index 3f4b749029..2980019181 100644 --- a/core/modules/help_topics/help_topics/security.help_topic.yml +++ b/core/modules/help_topics/help_topics/security.help_topic.yml @@ -3,9 +3,3 @@ label: 'Making your site secure' top_level: true related: { } list_on: { } -body: - - - text: 'The topics listed here will help you make and keep your site secure.' - prefix_tags: '

      ' - suffix_tags: '

      ' -body_format: help diff --git a/core/modules/help_topics/help_topics/security_account_settings.help_topic.yml b/core/modules/help_topics/help_topics/security_account_settings.help_topic.yml index 944c402adb..14dfddaac3 100644 --- a/core/modules/help_topics/help_topics/security_account_settings.help_topic.yml +++ b/core/modules/help_topics/help_topics/security_account_settings.help_topic.yml @@ -6,25 +6,3 @@ related: list_on: - config_basic - security -body: - - - text: 'On the Account settings page, which you can reach from the Manage administrative menu, by navigating to Configuration > People > Account settings (requires the Administer account settings permission), you can configure several settings related to how user accounts are created:' - prefix_tags: '

      ' - suffix_tags: '

      ' - - - text: 'You can make it possible for new users to register themselves, with or without administrator approval. Or, you can make it so only administrators with Administer users permission can register new users.' - prefix_tags: '
      • ' - suffix_tags: '
      • ' - - - text: 'You can require email verification of new user accounts.' - prefix_tags: '
      • ' - suffix_tags: '
      • ' - - - text: 'You can enable or disable a password strength indicator, which is shown whenever passwords are being set up or changed.' - prefix_tags: '
      • ' - suffix_tags: '
      • ' - - - text: 'You can edit the email messages that are sent to users in conjunction with the user registration process.' - prefix_tags: '
      • ' - suffix_tags: '
      ' -body_format: help diff --git a/core/modules/help_topics/templates/help-topic-config-basic.html.twig b/core/modules/help_topics/help_topics/templates/help-topic-config-basic.html.twig similarity index 79% rename from core/modules/help_topics/templates/help-topic-config-basic.html.twig rename to core/modules/help_topics/help_topics/templates/help-topic-config-basic.html.twig index 8108c34017..1a5b686c97 100644 --- a/core/modules/help_topics/templates/help-topic-config-basic.html.twig +++ b/core/modules/help_topics/help_topics/templates/help-topic-config-basic.html.twig @@ -4,9 +4,7 @@

      {% trans %}The settings for your site are configured on various administrative pages, as follows:{% endtrans %}

      {% trans %}Site name, slogan, and email address{% endtrans %}
      -
      {% trans %} - On the Basic site settings page, which you can reach in the main Manage administrative menu, by navigating to Configuration > System > Basic site settings. - {% endtrans %}
      +
      {% trans %}On the Basic site settings page, which you can reach in the main Manage administrative menu, by navigating to Configuration > System > Basic site settings.{% endtrans %}
      {% trans %}Time zone and country{% endtrans %}
      {% trans %}On the Regional settings page, which you can reach in the main Manage administrative menu, by navigating to Configuration > Regional and language > Regional settings.{% endtrans %}
      {% trans %}Date and time formats{% endtrans %}
      diff --git a/core/modules/help_topics/help_topics/templates/help-topic-config-error.html.twig b/core/modules/help_topics/help_topics/templates/help-topic-config-error.html.twig new file mode 100644 index 0000000000..32eefdce0d --- /dev/null +++ b/core/modules/help_topics/help_topics/templates/help-topic-config-error.html.twig @@ -0,0 +1,8 @@ +{% set log_settings_url = render_var(url('system.logging_settings')) %} +{% set site_settings_url = render_var(url('system.site_information_settings')) %} +

      {% trans %}Configuring 403/404 pages{% endtrans %}

      +

      {% trans %}The core software provides default responses for 403 response (Not Authorized: when someone tries to visit a page they do not have permission to see) and 404 response (Not Found: when someone tries to visit a page that does not exist). You can change what page is displayed for these responses on the Basic site settings page, which you can reach in the main Manage administrative menu, by navigating to Configuration > System > Basic site settings. Note that the pages you want to use must already exist as either system-provided pages or content that you have created.{% endtrans %}

      +

      {% trans %}Responding to software errors{% endtrans %}

      +

      {% trans %}Software errors on your site are logged, if you have a logging module installed (such as the core Database Logging module or the core Syslog module). You can configure whether or not error messages are also shown (to both administrators and other site visitors) on the Logging and errors configuration page, which you can reach in the main Manage administrative menu, by navigating to Configuration > Development > Logging and errors.{% endtrans %}

      +

      {% trans %}Viewing the site log{% endtrans %}

      +

      {% trans %}If you have the core Database Logging module installed, you can view recent error and informational messages by navigating in the main Manage administrative menu to Reports > Recent log messages. If you are using the core Syslog module for logging, error messages will be logged in your web server''s log files.{% endtrans %}

      diff --git a/core/modules/help_topics/help_topics/templates/help-topic-help-topic-writing.html.twig b/core/modules/help_topics/help_topics/templates/help-topic-help-topic-writing.html.twig new file mode 100644 index 0000000000..ca43f59b18 --- /dev/null +++ b/core/modules/help_topics/help_topics/templates/help-topic-help-topic-writing.html.twig @@ -0,0 +1,7 @@ +

      {% trans %}Here are some suggestions for how to make your help topics as useful as possible for readers:{% endtrans %}

      +
        +
      • {% trans %}Choose short titles. If the topic describes a task, start with a verb in -ing form, like "Writing good help".{% endtrans %}
      • +
      • {% trans %}Make your topics modular and short, using links to connect information together.{% endtrans %}
      • +
      • {% trans %}Use headings and lists to organize your topics.{% endtrans %}
      • +
      • {% trans %}Write in second person (you, your). When describing a task, use imperative mood (tell people directly what to do, such as "Enter information in the ABC field", rather than using words like "please" or more passive or declarative language like "the ABC field needs to be filled in").{% endtrans %}
      • +
      diff --git a/core/modules/help_topics/help_topics/templates/help-topic-maintenance.html.twig b/core/modules/help_topics/help_topics/templates/help-topic-maintenance.html.twig new file mode 100644 index 0000000000..a42d8b6942 --- /dev/null +++ b/core/modules/help_topics/help_topics/templates/help-topic-maintenance.html.twig @@ -0,0 +1 @@ +

      {% trans %}The related topics listed here will help you keep your site running and troubleshoot problems.{% endtrans %}

      diff --git a/core/modules/help_topics/help_topics/templates/help-topic-menu-overview.html.twig b/core/modules/help_topics/help_topics/templates/help-topic-menu-overview.html.twig new file mode 100644 index 0000000000..9a119ab0c4 --- /dev/null +++ b/core/modules/help_topics/help_topics/templates/help-topic-menu-overview.html.twig @@ -0,0 +1 @@ +

      {% trans %}The related topics listed here describe how to set up various aspects of site navigation and URLs.{% endtrans %}

      diff --git a/core/modules/help_topics/help_topics/templates/help-topic-security-account-settings.html.twig b/core/modules/help_topics/help_topics/templates/help-topic-security-account-settings.html.twig new file mode 100644 index 0000000000..6db302beac --- /dev/null +++ b/core/modules/help_topics/help_topics/templates/help-topic-security-account-settings.html.twig @@ -0,0 +1,8 @@ +{% set account_settings_url = render_var(url('entity.user.admin_form')) %} +

      {% trans %}On the Account settings page, which you can reach from the Manage administrative menu, by navigating to Configuration > People > Account settings (requires the Administer account settings permission), you can configure several settings related to how user accounts are created:{% endtrans %}

      +
        +
      • {% trans %}You can make it possible for new users to register themselves, with or without administrator approval. Or, you can make it so only administrators with Administer users permission can register new users.{% endtrans %}
      • +
      • {% trans %}You can require email verification of new user accounts.{% endtrans %}
      • +
      • {% trans %}You can enable or disable a password strength indicator, which is shown whenever passwords are being set up or changed.{% endtrans %}
      • +
      • {% trans %}You can edit the email messages that are sent to users in conjunction with the user registration process.{% endtrans %}
      • +
      diff --git a/core/modules/help_topics/help_topics/templates/help-topic-security.html.twig b/core/modules/help_topics/help_topics/templates/help-topic-security.html.twig new file mode 100644 index 0000000000..4b94bb1af6 --- /dev/null +++ b/core/modules/help_topics/help_topics/templates/help-topic-security.html.twig @@ -0,0 +1 @@ +

      {% trans %}The topics listed here will help you make and keep your site secure.{% endtrans %}

      diff --git a/core/modules/help_topics/help_topics/templates/help-topic-ui-accessibility.html.twig b/core/modules/help_topics/help_topics/templates/help-topic-ui-accessibility.html.twig new file mode 100644 index 0000000000..0c014af6e6 --- /dev/null +++ b/core/modules/help_topics/help_topics/templates/help-topic-ui-accessibility.html.twig @@ -0,0 +1,5 @@ +

      {% trans %}The following features of the administrative user interface may help administrative users with disabilities access your site:{% endtrans %}

      +
      +
      {% trans %}Disabling drag-and-drop functionality{% endtrans %}
      +
      {% trans %}The default drag-and-drop user interface for ordering tables in the administrative interface presents a challenge for some users, including users of screen readers and other assistive technology. The drag-and-drop interface can be disabled in a table by clicking a link labeled Show row weights above the table. The replacement interface allows users to order the table by choosing numerical weights instead of dragging table rows.{% endtrans %}
      +
      diff --git a/core/modules/help_topics/help_topics/templates/help-topic-ui-components.html.twig b/core/modules/help_topics/help_topics/templates/help-topic-ui-components.html.twig new file mode 100644 index 0000000000..c33e24d834 --- /dev/null +++ b/core/modules/help_topics/help_topics/templates/help-topic-ui-components.html.twig @@ -0,0 +1 @@ +

      {% trans %}The related topics listed here describe various aspects of the administrative interface, and tell how to use them.{% endtrans %}

      diff --git a/core/modules/help_topics/help_topics/templates/help-topic-ui-contextual.html.twig b/core/modules/help_topics/help_topics/templates/help-topic-ui-contextual.html.twig new file mode 100644 index 0000000000..431f2b3c47 --- /dev/null +++ b/core/modules/help_topics/help_topics/templates/help-topic-ui-contextual.html.twig @@ -0,0 +1,9 @@ +

      {% trans %}What are contextual links?{% endtrans %}

      +

      {% trans %}Contextual links give users with the Use contextual links permission quick access to administrative tasks related to areas of non-administrative pages. For example, if a page on your site displays a block, the block would have a contextual link that would allow users with permission to configure the block. If the block contains a menu or a view, it would also have a contextual link for editing the menu links or the view. Clicking a contextual link takes you to the related administrative page directly, without needing to navigate through the administrative menu system.{% endtrans %}

      +

      {% trans %}Displaying and using contextual links{% endtrans %}

      +

      {% trans %}If you have the core Contextual Links module installed, the contextual links related to an area on a page can be displayed by clicking the contextual links button in that area of the page. In most themes, this button looks like a pencil and is placed in the upper right corner of the page area (upper left for right-to-left languages); however, contextual links buttons are normally hidden. Here are two ways to make contextual links buttons visible:{% endtrans %}

      +
        +
      • {% trans %}Hovering your mouse over an area on the page will temporarily make the contextual links button visible, if there is one for that area of the page. Also, in most themes, the page area that the contextual links pertain to will be outlined while you are hovering.{% endtrans %}
      • +
      • {% trans %}If you have the core Toolbar module enabled, there will be a contextual links toggle button at the far right end of the toolbar (far left end for right-to-left languages; this button looks like a pencil in most themes). Clicking the toggle button will make all the individual contextual links buttons on the page visible; clicking the toggle button again will make them invisible.{% endtrans %}
      • +
      +

      {% trans %}While the contextual links button for the area of interest is visible, click the button to display the list of links for that area. Click a link in the list to perform the task.{% endtrans %}

      diff --git a/core/modules/help_topics/help_topics/templates/help-topic-ui-shortcuts.html.twig b/core/modules/help_topics/help_topics/templates/help-topic-ui-shortcuts.html.twig new file mode 100644 index 0000000000..69536add95 --- /dev/null +++ b/core/modules/help_topics/help_topics/templates/help-topic-ui-shortcuts.html.twig @@ -0,0 +1,6 @@ +

      {% trans %}What are shortcuts?{% endtrans %}

      +

      {% trans %}Shortcuts are quick links to administrative pages; they are managed by the core Shortcut module. A site can have one or more shortcut sets, which can be shared by one or more users; each set contains one or more shortcuts. Users need Use shortcuts permission to view shortcuts; Edit current shortcut set permission to add, delete, or edit the shortcuts in the set assigned to them; and Select any shortcut set permission to select a different shortcut set when editing their user profile. There is also an Administer shortcuts permission, which allows an administrator to do any of these actions, and also permits assigning shortcut sets to other users.{% endtrans %}

      +

      {% trans %}Creating and deleting shortcuts{% endtrans %}

      +

      {% trans %}When viewing certain administrative pages, you will see a link that allows you to add the page to your current shortcut set. In the core Seven administrative theme, the link looks like a star, and is displayed next to the page title. If the page is already in your shortcut set, you will instead see a link that allows you to remove it.{% endtrans %}

      +

      {% trans %}Viewing and using shortcuts{% endtrans %}

      +

      {% trans %}If you have the core Toolbar module installed, click Shortcuts in the toolbar to display your shortcuts. Once they are displayed, click any link in the shortcut bar to go directly to the administrative page. If you are not using the Toolbar module, you can display shortcuts by placing the Shortcuts block in a region of your theme.{% endtrans %}

      diff --git a/core/modules/help_topics/help_topics/templates/help-topic-ui-tours.html.twig b/core/modules/help_topics/help_topics/templates/help-topic-ui-tours.html.twig new file mode 100644 index 0000000000..6a48a54786 --- /dev/null +++ b/core/modules/help_topics/help_topics/templates/help-topic-ui-tours.html.twig @@ -0,0 +1,4 @@ +

      {% trans %}What are tours?{% endtrans %}

      +

      {% trans %}The core Tour module provides users with tours, which are guided tours of the administrative interface. Each tour starts on a particular administrative page, and consists of one or more tips that highlight elements of the page, guide you through a workflow, or explain key concepts. Users need Access tour permission to view tours, and JavaScript must be enabled in their browsers.{% endtrans %}

      +

      {% trans %}Viewing tours{% endtrans %}

      +

      {% trans %}If a tour is available on a page, and you have the core Toolbar module installed, a Tour button will appear on the right end of the toolbar (left end for right-to-left languages). Click this button to view the first tip of the tour; click the Next button to advance to the next tip, and End tour at the end to close the tour.{% endtrans %}

      diff --git a/core/modules/help_topics/help_topics/ui_accessibility.help_topic.yml b/core/modules/help_topics/help_topics/ui_accessibility.help_topic.yml index 23c06d0eba..489f96cdbc 100644 --- a/core/modules/help_topics/help_topics/ui_accessibility.help_topic.yml +++ b/core/modules/help_topics/help_topics/ui_accessibility.help_topic.yml @@ -5,17 +5,3 @@ related: - ui_components list_on: - ui_components -body: - - - text: 'The following features of the administrative user interface may help administrative users with disabilities access your site:' - prefix_tags: '

      ' - suffix_tags: '

      ' - - - text: 'Disabling drag-and-drop functionality' - prefix_tags: '
      ' - suffix_tags: '
      ' - - - text: 'The default drag-and-drop user interface for ordering tables in the administrative interface presents a challenge for some users, including users of screen readers and other assistive technology. The drag-and-drop interface can be disabled in a table by clicking a link labeled Show row weights above the table. The replacement interface allows users to order the table by choosing numerical weights instead of dragging table rows.' - prefix_tags: '
      ' - suffix_tags: '
      ' -body_format: help diff --git a/core/modules/help_topics/help_topics/ui_components.help_topic.yml b/core/modules/help_topics/help_topics/ui_components.help_topic.yml index ff58918492..098d584491 100644 --- a/core/modules/help_topics/help_topics/ui_components.help_topic.yml +++ b/core/modules/help_topics/help_topics/ui_components.help_topic.yml @@ -3,9 +3,3 @@ label: 'Using the administrative interface' top_level: true related: { } list_on: { } -body: - - - text: 'The related topics listed here describe various aspects of the administrative interface, and tell how to use them.' - prefix_tags: '

      ' - suffix_tags: '

      ' -body_format: help diff --git a/core/modules/help_topics/help_topics/ui_contextual.help_topic.yml b/core/modules/help_topics/help_topics/ui_contextual.help_topic.yml index 21393789c9..4b3c23d3a7 100644 --- a/core/modules/help_topics/help_topics/ui_contextual.help_topic.yml +++ b/core/modules/help_topics/help_topics/ui_contextual.help_topic.yml @@ -5,33 +5,3 @@ related: - ui_components list_on: - ui_components -body: - - - text: 'What are contextual links?' - prefix_tags: '

      ' - suffix_tags: '

      ' - - - text: 'Contextual links give users with the Use contextual links permission quick access to administrative tasks related to areas of non-administrative pages. For example, if a page on your site displays a block, the block would have a contextual link that would allow users with permission to configure the block. If the block contains a menu or a view, it would also have a contextual link for editing the menu links or the view. Clicking a contextual link takes you to the related administrative page directly, without needing to navigate through the administrative menu system.' - prefix_tags: '

      ' - suffix_tags: '

      ' - - - text: 'Displaying and using contextual links' - prefix_tags: '

      ' - suffix_tags: '

      ' - - - text: 'If you have the core Contextual Links module installed, the contextual links related to an area on a page can be displayed by clicking the contextual links button in that area of the page. In most themes, this button looks like a pencil and is placed in the upper right corner of the page area (upper left for right-to-left languages); however, contextual links buttons are normally hidden. Here are two ways to make contextual links buttons visible:' - prefix_tags: '

      ' - suffix_tags: '

      ' - - - text: 'Hovering your mouse over an area on the page will temporarily make the contextual links button visible, if there is one for that area of the page. Also, in most themes, the page area that the contextual links pertain to will be outlined while you are hovering.' - prefix_tags: '
      • ' - suffix_tags: '
      • ' - - - text: 'If you have the core Toolbar module enabled, there will be a contextual links toggle button at the far right end of the toolbar (far left end for right-to-left languages; this button looks like a pencil in most themes). Clicking the toggle button will make all the individual contextual links buttons on the page visible; clicking the toggle button again will make them invisible.' - prefix_tags: '
      • ' - suffix_tags: '
      ' - - - text: 'While the contextual links button for the area of interest is visible, click the button to display the list of links for that area. Click a link in the list to perform the task.' - prefix_tags: '

      ' - suffix_tags: '

      ' -body_format: help diff --git a/core/modules/help_topics/help_topics/ui_shortcuts.help_topic.yml b/core/modules/help_topics/help_topics/ui_shortcuts.help_topic.yml index eac86fd023..24af5d2408 100644 --- a/core/modules/help_topics/help_topics/ui_shortcuts.help_topic.yml +++ b/core/modules/help_topics/help_topics/ui_shortcuts.help_topic.yml @@ -5,29 +5,3 @@ related: - ui_components list_on: - ui_components -body: - - - text: 'What are shortcuts?' - prefix_tags: '

      ' - suffix_tags: '

      ' - - - text: 'Shortcuts are quick links to administrative pages; they are managed by the core Shortcut module. A site can have one or more shortcut sets, which can be shared by one or more users; each set contains one or more shortcuts. Users need Use shortcuts permission to view shortcuts; Edit current shortcut set permission to add, delete, or edit the shortcuts in the set assigned to them; and Select any shortcut set permission to select a different shortcut set when editing their user profile. There is also an Administer shortcuts permission, which allows an administrator to do any of these actions, and also permits assigning shortcut sets to other users.' - prefix_tags: '

      ' - suffix_tags: '

      ' - - - text: 'Creating and deleting shortcuts' - prefix_tags: '

      ' - suffix_tags: '

      ' - - - text: 'When viewing certain administrative pages, you will see a link that allows you to add the page to your current shortcut set. In the core Seven administrative theme, the link looks like a star, and is displayed next to the page title. If the page is already in your shortcut set, you will instead see a link that allows you to remove it.' - prefix_tags: '

      ' - suffix_tags: '

      ' - - - text: 'Viewing and using shortcuts' - prefix_tags: '

      ' - suffix_tags: '

      ' - - - text: 'If you have the core Toolbar module installed, click Shortcuts in the toolbar to display your shortcuts. Once they are displayed, click any link in the shortcut bar to go directly to the administrative page. If you are not using the Toolbar module, you can display shortcuts by placing the Shortcuts block in a region of your theme.' - prefix_tags: '

      ' - suffix_tags: '

      ' -body_format: help diff --git a/core/modules/help_topics/help_topics/ui_tours.help_topic.yml b/core/modules/help_topics/help_topics/ui_tours.help_topic.yml index 2bb4cf370e..7f5c9872df 100644 --- a/core/modules/help_topics/help_topics/ui_tours.help_topic.yml +++ b/core/modules/help_topics/help_topics/ui_tours.help_topic.yml @@ -5,21 +5,3 @@ related: - ui_components list_on: - ui_components -body: - - - text: 'What are tours?' - prefix_tags: '

      ' - suffix_tags: '

      ' - - - text: 'The core Tour module provides users with tours, which are guided tours of the administrative interface. Each tour starts on a particular administrative page, and consists of one or more tips that highlight elements of the page, guide you through a workflow, or explain key concepts. Users need Access tour permission to view tours, and JavaScript must be enabled in their browsers.' - prefix_tags: '

      ' - suffix_tags: '

      ' - - - text: 'Viewing tours' - prefix_tags: '

      ' - suffix_tags: '

      ' - - - text: 'If a tour is available on a page, and you have the core Toolbar module installed, a Tour button will appear on the right end of the toolbar (left end for right-to-left languages). Click this button to view the first tip of the tour; click the Next button to advance to the next tip, and End tour at the end to close the tour.' - prefix_tags: '

      ' - suffix_tags: '

      ' -body_format: help diff --git a/core/modules/help_topics/src/HtmlChunker.php b/core/modules/help_topics/src/HtmlChunker.php deleted file mode 100644 index e87ee010ad..0000000000 --- a/core/modules/help_topics/src/HtmlChunker.php +++ /dev/null @@ -1,199 +0,0 @@ -getElementsByTagName('body')->item(0); - if ($body_node) { - $chunks = self::chunkDomNode($dom, $body_node); - } - return $chunks; - } - - /** - * Joins chunks into an HTML string. - * - * @param array $chunks - * Array of chunks, each of which is an array with elements: - * - text: Text content of the chunk, which may contain HTML. - * - prefix_tags: HTML tags that go before the text content. - * - suffix_tags: HTML tags that go after the text content. - * - * @return string - * HTML string containing all of the chunks. - * - * @see \Drupal\help_topics\HtmlChunker::chunkHtml() - */ - public static function joinChunks(array $chunks) { - $text = ''; - foreach ($chunks as $chunk) { - $text .= $chunk['prefix_tags'] . $chunk['text'] . $chunk['suffix_tags']; - } - return $text; - } - - /** - * Splits a DOM node recursively into chunks. - * - * @param \DOMDocument $dom - * The DOM document this came from. - * @param \DOMNode $node - * DOM node to split into chunks. - * @param string $prefix - * (optional) Prefix tags to put on first chunk. - * @param string $suffix - * (optional) Suffix tags to put on last chunk. - * - * @return array - * Array of chunks from $node. Each chunk is an array with elements: - * - text: Text content of the chunk, which may contain HTML. - * - prefix_tags: HTML tags that go before the text content. - * - suffix_tags: HTML tags that go after the text content. - * The intent is that if you concatenate all the chunks' prefix_tags, - * text, and suffix_tags, you will end up with the original HTML. - */ - protected static function chunkDomNode(\DOMDocument $dom, \DOMNode $node, $prefix = '', $suffix = '') { - - // These HTML tags generate an automatic chunk. - $chunk_tags = [ - 'p', - 'h1', - 'h2', - 'h3', - 'h4', - 'h5', - 'h6', - 'li', - 'dt', - 'dd', - 'code', - 'pre', - 'blockquote', - 'td', - 'th', - 'caption', - ]; - - $chunks = []; - foreach ($node->childNodes as $child) { - switch ($child->nodeType) { - case XML_ELEMENT_NODE: - if (!$child->hasChildNodes()) { - // It's an empty element, so just add it to the prefix for the - // next chunk. - $prefix .= trim($dom->saveXML($child)); - } - else { - $open_tag = '<' . $child->tagName; - if ($child->hasAttributes()) { - foreach ($child->attributes as $attr) { - $open_tag .= $dom->saveXML($attr); - } - } - $open_tag .= '>'; - $close_tag = 'tagName . '>'; - - if (in_array($child->tagName, $chunk_tags)) { - // Don't go deeper, just save everything this node contains - // as one chunk. - $text = ''; - foreach ($child->childNodes as $inner) { - $text .= $dom->saveXML($inner); - } - $chunks[] = [ - 'text' => $text, - 'prefix_tags' => $prefix . $open_tag, - 'suffix_tags' => $close_tag, - ]; - $prefix = ''; - } - else { - // Recursively generate chunks from this node's children. - $new_chunks = self::chunkDomNode($dom, $child, $prefix . $open_tag, $close_tag); - $chunks = array_merge($chunks, $new_chunks); - $prefix = ''; - } - } - break; - - case XML_TEXT_NODE: - // Add non-empty text nodes as their own chunks. Some text nodes - // are purely inter-tag whitespace; leave those out. - $text = $dom->saveXML($child); - // For some reason, these text nodes ar often containing the - // carriage return character as an entity, so decode that - // specifically. - $text = str_replace(' ', "\r", $text); - if (trim($text)) { - $chunks[] = [ - 'text' => $text, - 'prefix_tags' => $prefix, - 'suffix_tags' => '', - ]; - $prefix = ''; - } - break; - - default: - // For nodes that are anything except elements or text, just add - // them to the prefix we are working on. These are things like HTML - // comments, for example. - $prefix .= trim($dom->saveXML($child)); - break; - } - } - - // If we have prefix left over, add it as a chunk. - if ($prefix) { - $chunks[] = [ - 'text' => '', - 'prefix_tags' => $prefix, - 'suffix_tags' => '', - ]; - } - - // If we have a suffix left over, add it to the last chunk. - if ($suffix) { - if (!$chunks) { - $chunks[] = [ - 'text' => '', - 'prefix_tags' => '', - 'suffix_tags' => '', - ]; - } - $chunks[count($chunks) - 1]['suffix_tags'] .= $suffix; - } - - return $chunks; - } - -} diff --git a/core/modules/help_topics/src/Plugin/HelpTopic/HelpTopicPluginManager.php b/core/modules/help_topics/src/Plugin/HelpTopic/HelpTopicPluginManager.php index 2bea26dbae..c003babbcc 100644 --- a/core/modules/help_topics/src/Plugin/HelpTopic/HelpTopicPluginManager.php +++ b/core/modules/help_topics/src/Plugin/HelpTopic/HelpTopicPluginManager.php @@ -34,10 +34,6 @@ class HelpTopicPluginManager extends DefaultPluginManager implements HelpTopicPl 'related' => [], // List of topics this one should be listed on. 'list_on' => [], - // The unprocessed topic body text. - 'body' => [], - // The machine name of the text format for the body in HTML form. - 'body_format' => [], 'class' => HelpTopicTwig::class, 'cache_tag' => '', ]; diff --git a/core/modules/help_topics/src/Plugin/HelpTopic/HelpTopicTwig.php b/core/modules/help_topics/src/Plugin/HelpTopic/HelpTopicTwig.php index 66b6a1e454..d66dd14044 100644 --- a/core/modules/help_topics/src/Plugin/HelpTopic/HelpTopicTwig.php +++ b/core/modules/help_topics/src/Plugin/HelpTopic/HelpTopicTwig.php @@ -43,7 +43,7 @@ public function __construct(ContainerInterface $container, array $configuration, * @param array $plugin_definition * The plugin definition. * - * @return $this + * @return static */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { return new static($container, $configuration, $plugin_id, $plugin_definition); @@ -66,16 +66,16 @@ public function getBody() { } /** - * Gets theme hook from plugin ID. + * Gets the theme hook from then plugin ID. * - * @param string $pluginId + * @param string $plugin_id * Plugin id. * * @return string * Theme hook. */ - public static function getThemeHook($pluginId) { - return 'help_topic_' . $pluginId; + public static function getThemeHook($plugin_id) { + return 'help_topic_' . $plugin_id; } } diff --git a/core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_test.help_topic.yml b/core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_test.help_topic.yml new file mode 100644 index 0000000000..ccaed3d529 --- /dev/null +++ b/core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_test.help_topic.yml @@ -0,0 +1,6 @@ +id: help_test +label: 'ABC Help Test module' +top_level: true +related: + - help_test_linked +list_on: { } diff --git a/core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_test_additional.help_topic.yml b/core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_test_additional.help_topic.yml new file mode 100644 index 0000000000..ae331663a1 --- /dev/null +++ b/core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_test_additional.help_topic.yml @@ -0,0 +1,6 @@ +id: help_test_additional +label: 'Additional topic' +top_level: false +related: { } +list_on: + - help_test diff --git a/core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_test_linked.help_topic.yml b/core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_test_linked.help_topic.yml new file mode 100644 index 0000000000..2c572a244e --- /dev/null +++ b/core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_test_linked.help_topic.yml @@ -0,0 +1,5 @@ +id: help_test_linked +label: 'Linked topic' +top_level: false +related: { } +list_on: { } diff --git a/core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_topics.topic.help_test.yml b/core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_topics.topic.help_test.yml deleted file mode 100644 index d4c800a4bd..0000000000 --- a/core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_topics.topic.help_test.yml +++ /dev/null @@ -1,12 +0,0 @@ -id: help_test -label: 'ABC Help Test module' -top_level: true -related: - - help_test_linked -list_on: { } -body: - - - text: 'This is a test. It should link to the writing good help topic. Also there should be a related topic link below to the Help module topic page and the linked topic.' - prefix_tags: '

      ' - suffix_tags: '

      ' -body_format: help diff --git a/core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_topics.topic.help_test_additional.yml b/core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_topics.topic.help_test_additional.yml deleted file mode 100644 index 704fd3786d..0000000000 --- a/core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_topics.topic.help_test_additional.yml +++ /dev/null @@ -1,12 +0,0 @@ -id: help_test_additional -label: 'Additional topic' -top_level: false -related: { } -list_on: - - help_test -body: - - - text: 'This topic should get listed automatically on the Help test topic.' - prefix_tags: '

      ' - suffix_tags: '

      ' -body_format: help diff --git a/core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_topics.topic.help_test_linked.yml b/core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_topics.topic.help_test_linked.yml deleted file mode 100644 index 62e6ab1f18..0000000000 --- a/core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_topics.topic.help_test_linked.yml +++ /dev/null @@ -1,11 +0,0 @@ -id: help_test_linked -label: 'Linked topic' -top_level: false -related: { } -list_on: { } -body: - - - text: 'This topic is not supposed to be top-level.' - prefix_tags: '

      ' - suffix_tags: '

      ' -body_format: help diff --git a/core/modules/help_topics/tests/modules/help_topics_test/help_topics/templates/help-topic-help-test-additional.html.twig b/core/modules/help_topics/tests/modules/help_topics_test/help_topics/templates/help-topic-help-test-additional.html.twig new file mode 100644 index 0000000000..7d8f2f9549 --- /dev/null +++ b/core/modules/help_topics/tests/modules/help_topics_test/help_topics/templates/help-topic-help-test-additional.html.twig @@ -0,0 +1 @@ +

      {% trans %}This topic should get listed automatically on the Help test topic.{% endtrans %}

      diff --git a/core/modules/help_topics/tests/modules/help_topics_test/help_topics/templates/help-topic-help-test-linked.html.twig b/core/modules/help_topics/tests/modules/help_topics_test/help_topics/templates/help-topic-help-test-linked.html.twig new file mode 100644 index 0000000000..2205cf45ad --- /dev/null +++ b/core/modules/help_topics/tests/modules/help_topics_test/help_topics/templates/help-topic-help-test-linked.html.twig @@ -0,0 +1 @@ +

      {% trans %}This topic is not supposed to be top-level.{% endtrans %}

      diff --git a/core/modules/help_topics/tests/modules/help_topics_test/help_topics/templates/help-topic-help-test.html.twig b/core/modules/help_topics/tests/modules/help_topics_test/help_topics/templates/help-topic-help-test.html.twig new file mode 100644 index 0000000000..65a7a5e86c --- /dev/null +++ b/core/modules/help_topics/tests/modules/help_topics_test/help_topics/templates/help-topic-help-test.html.twig @@ -0,0 +1,2 @@ +{% set help_topic_url = render_var(url('help_topics.help_topic', {id: 'help_topic_writing'})) %} +

      {% trans %}This is a test. It should link to the writing good help topic. Also there should be a related topic link below to the Help module topic page and the linked topic.{% endtrans %}

      diff --git a/core/modules/help_topics/tests/src/Functional/HelpTopicTest.php b/core/modules/help_topics/tests/src/Functional/HelpTopicTest.php index 94969a2a31..ecef9a6710 100644 --- a/core/modules/help_topics/tests/src/Functional/HelpTopicTest.php +++ b/core/modules/help_topics/tests/src/Functional/HelpTopicTest.php @@ -3,14 +3,17 @@ namespace Drupal\Tests\help_topics\Functional; use Drupal\Tests\BrowserTestBase; +use Drupal\Tests\system\Functional\Cache\AssertPageCacheContextsAndTagsTrait; /** * Verifies help topic display and user access to help based on permissions. * - * @group help + * @group help_topics */ class HelpTopicTest extends BrowserTestBase { + use AssertPageCacheContextsAndTagsTrait; + /** * Modules to enable. * @@ -21,7 +24,6 @@ class HelpTopicTest extends BrowserTestBase { 'help', 'help_topics', 'block', - 'filter', ]; /** @@ -74,7 +76,7 @@ protected function setUp() { public function testHelp() { // Log in the regular user. $this->drupalLogin($this->anyUser); - $this->verifyHelp(403, FALSE); + $this->verifyHelp(403); // Log in the admin user. $this->drupalLogin($this->adminUser); @@ -87,8 +89,9 @@ public function testHelp() { $session->responseContains('

      Topics

      '); $session->pageTextContains('Topics can be provided by modules or themes'); - // Verify the cache tag for the cache context for user permissions. - $this->assertCacheContext('user.permissions'); + // Verify the cache tag for the cache context for user permissions as well + // as the standard URL based ones. + $this->assertCacheContexts(['user.permissions', 'route', 'url.query_args:_wrapper_format']); // Verify links for for help topics and order. $page_text = $this->getTextContent(); @@ -118,12 +121,8 @@ public function testHelp() { * (optional) The HTTP response code to test for. If it's 200 (default), * the test verifies the user sees the help; if it's not, it verifies they * are denied access. - * @param bool $check_tags - * (optional) TRUE (default) to verify that the cache tags are on the page, - * even though the response is not a 200. Cache tags should be there except - * for users who don't even have 'view help topics' permission. */ - protected function verifyHelp($response = 200, $check_tags = TRUE) { + protected function verifyHelp($response = 200) { // Verify access to help topic pages. foreach ($this->getTopicList() as $topic => $info) { // View help topic page. @@ -134,16 +133,6 @@ protected function verifyHelp($response = 200, $check_tags = TRUE) { $name = $info['name']; $session->titleEquals($name . ' | Drupal'); $session->responseContains('

      ' . $name . '

      '); - // Check the cache tags. - foreach ($info['cache_tags'] as $tag) { - $this->assertCacheTag($tag); - } - } - elseif ($check_tags) { - // Check that the cache tags are there. - foreach ($info['cache_tags'] as $tag) { - $this->assertCacheTag($tag); - } } } } @@ -189,39 +178,11 @@ protected function getTopicList() { return [ 'help_test' => [ 'name' => 'ABC Help Test module', - 'cache_tags' => [ - 'config:filter.format.help', - ], ], 'help_topic_writing' => [ 'name' => 'Writing good help', - 'cache_tags' => [ - 'config:filter.format.help', - ], ], ]; } - /** - * Asserts that a given cache context exists. - * - * This was part of the Simpletest base class, but doesn't exist in - * BrowserTestBase. - */ - protected function assertCacheContext($expected_cache_context) { - $contexts = explode(' ', $this->getSession()->getResponseHeader('X-Drupal-Cache-Contexts')); - $this->assertTrue(in_array($expected_cache_context, $contexts), "'" . $expected_cache_context . "' is present in the X-Drupal-Cache-Contexts header."); - } - - /** - * Asserts that a given cache tag exists. - * - * This was part of the Simpletest base class, but doesn't exist in - * BrowserTestBase except in a legacy trait. - */ - protected function assertCacheTag($expected_cache_tag) { - $tags = explode(' ', $this->getSession()->getResponseHeader('X-Drupal-Cache-Tags')); - $this->assertTrue(in_array($expected_cache_tag, $tags), "'" . $expected_cache_tag . "' is present in the X-Drupal-Cache-Tags header."); - } - } diff --git a/core/modules/help_topics/tests/src/Kernel/HelpTopicTokensTest.php b/core/modules/help_topics/tests/src/Kernel/HelpTopicTokensTest.php index 695d3422e4..cdf02d0b90 100644 --- a/core/modules/help_topics/tests/src/Kernel/HelpTopicTokensTest.php +++ b/core/modules/help_topics/tests/src/Kernel/HelpTopicTokensTest.php @@ -10,7 +10,7 @@ /** * Tests token generation for help topics. * - * @group help + * @group help_topics */ class HelpTopicTokensTest extends KernelTestBase { @@ -25,7 +25,6 @@ class HelpTopicTokensTest extends KernelTestBase { 'help_topics_test', 'user', 'help', - 'filter', 'language', ]; @@ -38,7 +37,7 @@ protected function setUp() { // Set up as multi-lingual with English and Spanish, so that we can // test for cache metadata from URL generation. - $this->installConfig(['help_topics', 'help_topics_test', 'language']); + $this->installConfig(['language']); $this->installEntitySchema('configurable_language'); ConfigurableLanguage::create(['id' => 'es'])->save(); $this @@ -85,24 +84,4 @@ public function testHelpTopicTokens() { $this->assertTrue(in_array('languages:language_url', $contexts, 'Language negotiation cache context was added')); } - /** - * Tests that route tokens work. - */ - public function testRouteTokens() { - // Verify correct URL for a system route. - $bubbleable_metadata = new BubbleableMetadata(); - $text = 'This should Link to admin'; - $replaced = \Drupal::token()->replace($text, [], [], $bubbleable_metadata); - $this->assertTrue(strpos($replaced, 'getCacheContexts(); - $this->assertTrue(in_array('languages:language_url', $contexts, 'Language negotiation cache context was added')); - - // Verify there is no replacement for an invalid route. - $text = 'This should Not link to admin'; - $replaced = \Drupal::token()->replace($text); - $this->assertTrue(strpos($replaced, '[route:url:system.nonexistent]') !== FALSE, 'Nonexistent route was not replaced'); - } - } diff --git a/core/modules/help_topics/tests/src/Kernel/HtmlChunkerTest.php b/core/modules/help_topics/tests/src/Kernel/HtmlChunkerTest.php deleted file mode 100644 index 328cff224a..0000000000 --- a/core/modules/help_topics/tests/src/Kernel/HtmlChunkerTest.php +++ /dev/null @@ -1,58 +0,0 @@ -A paragraph with attributes

      '; - $body2 = '

      A heading with an & entity in it

      ' . - ' some between-tag text with whitespace and containing a tag as entity <p> ' . - '

      A sub-heading

      ' . - '
      • Bullet 1
      • Bullet 2
      ' . - '
      1. Number 1
      2. Number 2
      ' . - '
      ' . - '
      Col 1Col 2
      Data 1Data 2
      ' . - '
      Item 1 with spaces
      Definition 1
      Item 2 >
      Definition 2
      '; - $body = $body1 . "\t\n\r\v " . $body2; - $body_expected = $body1 . $body2; - - // Make sure after chunk/join, the body is unchanged except expected - // whitespace deletions. - $body_chunked = HtmlChunker::chunkHtml($body); - $body_out = HtmlChunker::joinChunks($body_chunked); - $this->assertEqual($body_expected, $body_out); - - // Make sure that if we strip out tags, all remaining text is in the 'text' - // parts of the chunked body array. - $body_plain = strip_tags($body_expected); - $chunked_text = ''; - foreach ($body_chunked as $item) { - $prefix = strip_tags($item['prefix_tags']); - $suffix = strip_tags($item['suffix_tags']); - // Prefix and suffix should only consist of tags. - $this->assertTrue(empty($prefix)); - $this->assertTrue(empty($suffix)); - // We shouldn't have any text items that are pure whitespace. - $this->assertFalse(empty(trim($item['text']))); - $chunked_text .= $item['text']; - } - $this->assertEqual($body_plain, $chunked_text); - } - -}