Problem/Motivation

#3192585-10: Fix up topics to use new help_topic_link function noted that when a topic is missing (due to a module not being installed, a topic being deleted, or a typo by a developer), the generated link just says "Missing topic name", which is not very helpful. Here's an example from an in-development patch:
Screenshot of missing help topic link

It would be better if it gave you the ID of the missing topic, so at least you would have an idea what the topic was supposed to be about.

Steps to reproduce

To reproduce this, you would need to edit one of the help topic files to call the help_topic_link() function with a non-existing topic name as the first argument. Our current help topics only make links to topics that exist, and only to topics in the same module or one of its dependencies.

Proposed resolution

If the help_topic_link() Twig function encounters a missing topic, make the fallback text include the topic ID. This is similar to the way missing modules are displayed on the module listing on admin/modules.

Remaining tasks

- discuss
- patch/commit

User interface changes

Instead of just saying "Missing help topic", the text for a missing help topic link will include the topic ID.

API changes

no

Data model changes

no

Release notes snippet

no

CommentFileSizeAuthor
#3 3213022-3.patch1.18 KBandypost
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andypost created an issue. See original summary.

jhodgdon’s picture

Issue summary: View changes

Updating issue summary to clarify.

Also andypost do you want to make a patch? Seems you already posted a patch on on #15 of that issue. It would just need a test.

andypost’s picture

Title: Provide helpful falback when help topic is missing to generate a link » Provide helpful fallback when help topic is missing to generate a link
Status: Active » Needs review
FileSize
1.18 KB

I think it should be enough for test coverage

mitthukumawat’s picture

I have cleanly applied the patch and the help topic link has been generated.

daffie’s picture

jhodgdon’s picture

Title: Provide helpful fallback when help topic is missing to generate a link » When generating link to non-existent help topic, put topic ID in fallback text
Category: Feature request » Bug report
Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
Issue tags: +Quick fix, +Usability

I have reviewed the patch code and test update, and they both look good to me. Manually testing this patch requires creating a topic where there is a link to a nonexistent topic (which we try to avoid in actual topics). The test coverage does exactly that, and since the test passes, that has been verified. This is a super simple patch, plus a good idea, so I think that is good enough to mark it RTBC.

I am reclassifying this as a bug report, because it seems like a usability bug if you get "Missing help topic" with no further information when a topic is missing.

larowlan’s picture

Version: 9.3.x-dev » 9.2.x-dev
Status: Reviewed & tested by the community » Fixed
Issue tags: +Bug Smash Initiative

Committed d2647ca and pushed to 9.3.x. Thanks!

Backported to 9.2.x

  • larowlan committed 15a48b8 on 9.2.x
    Issue #3213022 by andypost, jhodgdon: When generating link to non-...
  • larowlan committed d2647ca on 9.3.x
    Issue #3213022 by andypost, jhodgdon: When generating link to non-...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.