Add tests to enforce correct use of help_topic_link and help_route_link functions

Created on 21 June 2021, over 3 years ago
Updated 22 June 2023, over 1 year ago

Problem/Motivation

On πŸ“Œ Make a way for help topics to generate links only if they work and are accessible Fixed , we created two new functions for making links in help topics that degrade nicely when the link cannot be accessed or doesn't exist: help_route_link and help_topic_link.

On 🌱 [META] Fix up topics to use new help_route_link function Fixed and #3192585: Fix up topics to use new help_topic_link function β†’ , we fixed up the existing help topics to use these functions.

On this issue, we want to enforce the correct use of those functions in a test. The test should add code to core/modules/help_topics/tests/src/Functional/HelpTopicsSyntaxTest to make sure that:

  • Both help_topic_link and help_route_link functions are being used for links and not the base Twig url() function.
  • If help_route_link or help_topic_link is used, the text is translated.
  • The syntax test includes "bad" examples to verify the tests are working, so there should also be "bad" examples added that violate those two test cases, to make sure the test is working properly.

Steps to reproduce

Proposed resolution

Add code to HelpTopicsSyntaxTest for these tests.

Remaining tasks

  1. Patch, review, commit.
  2. Add a change record to note that use of these functions is required by this test. See also the change record for πŸ“Œ Make a way for help topics to generate links only if they work and are accessible Fixed : https://www.drupal.org/node/3192582 β†’

User interface changes

No, test only

API changes

Sort of -- we'll be requiring use of these functions.

Data model changes

No.

Release notes snippet

No.

πŸ“Œ Task
Status

Fixed

Version

11.0 πŸ”₯

Component
HelpΒ  β†’

Last updated 26 days ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States jhodgdon Spokane, WA, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024