Problem/Motivation

If we get #2920309: Add experimental module for Help Topics committed, and eventually stable, we will have 2 help systems:

a) hook_help(), which has been around since Drupal 4.x, and allows each module to provide 1 module overview topic.
b) Help Topics, which is the new system, and allows core, modules, themes, and profiles each to provide as many topics as they want to.

This will be confusing to users if the two types of topics are in separate places on the main Help page (admin/help), and confusing to developers if they have to support both systems.

Proposed resolution

The goal here is to have just one help system. In order to do that, here are the things we need to do (they can mostly be done simultaneously):

Part 1: Rewrite existing module overview help as topics

1A: Child issue: #3041924: [META] Convert hook_help() module overview text to topics

1B: Closed (outdated): After all the topics are converted, they will most likely need to be reorganized. #2687107: Reorganize topics into sensible outline, and/or write more topics.

Part 2: Decide what to do with the help blocks on admin pages

There are two parts of hook_help() currently. One is for the module overview help pages, which are covered in Part 1. But we also need to figure out what to do with the parts of hook_help() that provide help text that goes into the Help block that can be displayed at the top of admin pages.

If we are going to get rid of this part of hook_help() as well, we will need to figure out how to replace it. TBD.

Part 3: Deal with displaying lingering hook_help() in contrib

Contrib modules will not immediately convert their hook_help() module overview pages to topics. So, we need to figure out how to display them on admin/help. The two possibilities:

a) Leave as-is. Module overviews in a separate section. But this should be moved down under Topics. See also
#2994748: Make a way for Help Page Sections to be ordered
- And the intro text for this section should link to a how-to for converting to Topics.

b) Make them automagically appear as Topics. Probably they should be put under a top-level topic called something like "Module overviews", with some text explaining that these are left over and maybe a link to how to convert them.

We need to decide which possibility is better. We can start working on this immediately after the initial patch is committed.

Part 4: Deprecate/remove core hook_help()

Once parts 1-3 are done, and the Topics module is otherwise ready to be Stable, we will need a core patch that:
a) Deprecates hook_help() [at least the part that has to do with module overviews -- see also part 2]
b) Removes all the module overview calls from Core hook_help() implementations, and/or the entire hook_help() implementations [depending on step 2]
c) Removes the Coder check and Coding Standard that every module must have a hook_help().
d) Makes the Topics part of help as stable, and makes sure the topics are visible in the Standard install profile.

This part needs to be postponed until parts 1-3 are done, plus the other "ready for stable" stuff is done in the parent roadmap issue.

Remaining tasks

Update the documentation at https://www.drupal.org/docs/8/core/modules/help

User interface changes

API changes

Data model changes

Release notes snippet

Comments

jhodgdon created an issue. See original summary.

jhodgdon’s picture

Some notes I'm removing from the parent "roadmap" issue that pertain to hook_help():

Are we keeping hook_help() or deprecating it? Sub-questions of this:

  • If removing, we'll need to consider both the "module overview page" help topic functionality [definitely overlaps with our new help topic functionality] and the "put help on top of admin pages" functionality [will be new functionality to write].
  • How to display the hook_help() implementations for module overview pages that still exist until it's fully gone.
  • Do we still even want the "module overview" functionality? Is it useful?
  • If we keep module overviews, do they belong in their own section of the Help page, or merged in with the more task-oriented topics that this new module provides?
  • If removing, we'll need to consider both the "module overview page" help topic functionality [definitely overlaps with our new help topic functionality] and the "put help on top of admin pages" functionality [will be new functionality to write].
  • How to display the hook_help() implementations for module overview pages that still exist until it's fully gone.
  • Do we still even want the "module overview" functionality? Is it useful?
  • If we keep module overviews, do they belong in their own section of the Help page, or merged in with the more task-oriented topics that this new module provides?

In other words... I made a summary here with a proposed plan, but it is still open for discussion.

jhodgdon’s picture

Also some comments from @xjm on the other issue about this:

It's also not great to have two systems terms of code duplication and technical debt. From a release management perspective, I think we need to deprecate hook_help() if we add this module. (Which is cool, because hook_help() is very legacy.)

And then given that converting all the hook_help() to the new format is a big task, we shouldn't try to do that before we release Drupal 9, which means that hook_help() should be deprecated for removal in Drupal 10. (This is one of the things we would deprecate for removal in Drupal 10 even if it were deprecated in Drupal 8.) It might be possible to script a megapatch that converts all core help to Twig templates in the relevant locations. (Edit: Though I shudder to think about reviewing that.) Otherwise, this is the sort of deprecation that we might add to the list of skipped deprecations as we proceed through the conversions.

larowlan’s picture

I raised this (and the help topics patch) again with release managers and @catch advised that he'd like to see a more explicit plan here that had steps for a contributor who wanted to take it on once the other patch landed.

So should we repurpose this as a meta and provide instructions for how we'd tackle it (e.g. perhaps step one would be an audit to identify topics we need and where each hook help maps into said topics)? i.e. split step 2 from the issue summary into smaller chunks.

jhodgdon’s picture

Title: Deprecated hook_help() and combine with Topics » Deprecate hook_help() and combine with Topics
Issue summary: View changes
Related issues: +#2687107: Reorganize topics into sensible outline, and/or write more topics

Here is a stab at updating the issue summary with a better plan.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

jhodgdon’s picture

Issue summary: View changes

Created child issue for doing the conversions. Updating issue summary.

jhodgdon’s picture

Issue summary: View changes

Adding a new step. After help is all converted, we will need to reorganize!

amber himes matz’s picture

Updating this issue with conversation with @xjm and @benjifisher at the DrupalCon Seattle sprint.

One of the release managers' (xjm and catch) concerns is how to manage the duplicated help. (Module overviews in hook_help and in a Help Topic Twig template.) Worst-case scenario is that we do not finish the roadmap in time for the 8.8 release, and then we have to maintain the new Twig templates with any changes to the existing core modules (new modules, deleted modules, changes to `hook_help()`) for existing modules).

Can we think of a way to check for changes to a core modules' hook_help() diverging from the contents in the corresponding topic Twig template? From the release managers' perspective (as I understanding it), having a plan for dealing with this is essential before the experimental module issue (2920309) can be committed.

webchick’s picture

I worked on the original hook_help() patch WAY back in the day #26139: Admin help in core modules, and the way we managed this was to keep the "canonical" version of the docs on Drupal.org, and write a script to dump it into the proper format. That might be the way to do it here, both for hook_help() as well as the topic-based help, since it reduces the barrier of entry to hit "edit" on a page (or read it directly) vs. write a patch.

jhodgdon’s picture

Thanks for all the discussions -- sorry I couldn't be there in person.

So, I see the following concerns:

a) Making sure that we cover the correct list of modules (for additions and deletions). I have added that to the Remaining Tasks on #3041924: [META] Convert hook_help() module overview text to topics
See also item (c) in this comment.

b) Dealing with content duplication between hook_help() and topics. ... So... If we are going to convert hook_help() to topics, I don't think we can (or want to) make one huge patch that converts everything. That patch would never get done. This is why we have broken it up into:
- #3041924: [META] Convert hook_help() module overview text to topics -- to convert each module separately
- #2687107: Reorganize topics into sensible outline, and/or write more topics -- to look over the list of topics, reorganize, and write more if necessary
- #3037230: Finalize the merge of Help Topics into Help -- which includes the task of removing existing hook_help() implementations and deprecating hook_help()

In the interim, if people enable the Help Topics module (which is labeled as Experimental), they will see duplication of help content between the Module Overviews section on admin/help (which comes from hook_help()) and the Help Topics section (which comes from Help Topic Twig templates). I don't think there is any way around that, except waiting to commit the topics until they're all written and do it in one huge commit. Which I don't really see as viable (that patch would just never be reviewable). But given that you need to enable an experimental module to see the duplicated content, I think/hope this is OK.

c) Dealing with updates to hook_help content between when we make a patch for a module and when we remove hook_help. I think this is most appropriately dealt with on #2687107: Reorganize topics into sensible outline, and/or write more topics, so I have added a Remaining Task to that issue about it, and also updated its title.

jhodgdon’s picture

Regarding comment 10, that might be viable... But we don't want to just copy/paste the (mostly not all that helpful) information in hook_help() into topics. What we want to end up with is a task-oriented outline of topics, not a list of modules like we have now. So, we will not be able to have the same information being scripted to get into hook_help as well as topics. This is why my suggestion (see previous comment) is that when we're about to make the module not experimental any more, and thus about to remove hook_help() implementations, we manually review the existing hook_help at that time and make sure all the information is somewhere in the topics. Which may take a while to review, but that's I think OK. We can definitely do it.

webchick’s picture

Sorry, yes, I understand (and wholeheartedly approve!) that it's not a 1:1 ratio of hook_help() to topics. I was more getting at a possible way to both work on / review this iteratively and also do an "all in one patch" without overwhelming anyone.

amber himes matz’s picture

@xjm @catch We've tried to address your concerns about content duplication and I believe we have a good commitment and plan to deal with the transition. See #11 for links to the relevant issues. Pending any other issues that come up in a more thorough review of the patch, does this "unblock" the release managers' earnest review of #2920309 Add experimental module for Help Topics?

geek-merlin’s picture

This is a great step and i'm strongly for deprecating the module-help-page part of hook_help. That's why i added #3048641: Let module help fallback to help_topic:mymodule.about (before i realized this issue, so this may or may not be merged here.)

For the help-block part of hook_help though, i'm not so sure. If we just want to show mostly static help text on determined routes, we might add something like a "applies-to-page" meta tag on a help topic. But what about dynamic content on dynamically determined routes/paths? Of course, many of such use cases can be realized by altering page content, a form, or providing a block. What this does not give us is the standardized semantic context of the help block. But i think we can live with that out-of-the-box semantics, given that having dedicated blocks may offer even more semantic context. So all in all, i strongly welcome this.

Also see #3048650: Add "Relevant help topics" block (or re-purpose help block).

jhodgdon’s picture

My feeling is that the help block should go away, really. If a form needs help on it, then either the form needs to be redesigned for better usability if it's unlcear, or maybe the help can just be deleted (some of them say things like "Fill out this form and submit it", or at least they used to), or it needs a Tour to help explain it to first-time users (much more flexible than just 1 block of help text at the top), or the text can be added to the form directly. I don't really see the utility of the hook_help block.

So... I propose that we replace the help block part of hook_help() with Tours, and/or put the information directly on the form if it is really vital that everyone see it, and/or remove it if it's not actually helpful. Any thoughts on that proposal?

geek-merlin’s picture

I think there are different points to it, and we have to separete "hook_help" from "the help block".

As system architect i like the standardized design feature of the help block. The theme adds some styling that makes clear "This is some additional helpful information for this page". Emotionally, i really like the help block.

Also, Drupal is component lego. If i want to add some information to a page that i do not control, where do i go? I have no idea about the general form structure. If i just add some text on top, i probably break some design. In this situation, the help hook/block is a cozy warm standard place to use. The designer knows it's there and that something may be in it. We often use it to add additional info to content add/edit forms or config forms controlled by other components.

In other words, we could live without that, but my gut feeling is, we would reinvent a kind of replacement soon.
(Which does not mean i start fighting for hook_help, just thinking aloud. And who knows, maybe the replacement is a win.)

jhodgdon’s picture

Tours can definitely be used for all of that, plus they are more flexible than having a single help block (you can attach them to various UI elements on the page). Also, you can have multiple tours per page (so module A can add a tour to a page provided by module B). And if you have the Tour module installed, there is a link/icon/something in the toolbar that indicates a tour is available for the page you are on.

So, I really think that would be the way to go.

geek-merlin’s picture

Tours are a great feature, but even for sighted users, they have accessibility issues: You can't overview them and scroll to a particular point of information.

It's the same why i usually prefer a writeup over a video.

jhodgdon’s picture

Is there an issue about that problem with Tours? Sounds like something that could be fixed. But anyway, as a replacement for the help block, a tour would only have one tip. :)

andypost’s picture

As a fallback we could add "help_deprecated" module to maintain BC for d9/10

luwoldy’s picture

Created issue #3067614: Convert filter, ckeditor, editor module hook_help() to topic(s) as part of a first-time contributor workshop, feedback appreciated.

jhodgdon’s picture

Ah, that should have been posted on the parent issue #3041924: [META] Convert hook_help() module overview text to topics... looks like it got posted there too, so no worries. :)

mpp’s picture

Issue summary: View changes
andrewmacpherson’s picture

#16 - #20:

There are significant accessibility problems with tour module. At the moment it's really only usable by sighted people, using a random access input device (pointer, maybe speech control).

Replacing the help block with tour should be blocked by #2961001: [META] Improve accessibility of tour module. I've left a detailed list of problems there, together with some ideas for how to address them.

If a page has more than one tour, how does the user know which tour they are going on? It sounds like it will need more start-tour buttons, and those tours are going to need names to distinguish them. Otherwise they are... mystery tours!

#19:

You can't overview them and scroll to a particular point of information.

Can you elaborate on this please, over at #2961001: [META] Improve accessibility of tour module?

It sounds like it might overlap with a suggestion I made there, for a way to indicate that "extra help is available for this thing".

--

One thing that strikes me about tours, is that they assume there's something to point at. That's OK for various controls on a page, but it doesn't help with the overall question: "what is this page for?". That isn't always easy to say in a short page title, so having some preamble to a form seems like something that there will always be a need for. (It doesn't have to be a block though; FAPI #markup will still be available.)

andrewmacpherson’s picture

andypost’s picture

Moreover it will use other library

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

andypost’s picture

Status: Postponed » Active

As all topics ready

jhodgdon’s picture

I guess we can make a patch for this, but it shouldn't be finalized until someone decides Help Topics is Stable and we're really trying to finalize the merge of topics into the Help module.

Also I think this issue needs a summary update. It seems to be covering all of #3037230: Finalize the merge of Help Topics into Help or at least I'm not sure what this issue is actually about, given that the title is not the same as the summary.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

catch’s picture

Is there an issue somewhere for the help block help, or is this that issue?

andypost’s picture

I bet this issue is about to deprecate the hook_help() and the help block (help sections are rendered via \Drupal\help\Controller\HelpController::helpMain()), gonna hack on it

andypost’s picture

Yes, help block needs own issue

andypost’s picture

First child issue is done, so now waiting to consider help topics stable

amber himes matz’s picture

Issue summary: View changes

Updated issue summary.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

andypost’s picture

This issue will be meta is we consider it actionable, still not clear how properly transition from requiring help topics instead of hook help

The core's kill-switch for documentation gate in #3074040: Move testing of help topic rendering into child of GenericModuleTestBase (I re-parented it)

fgm’s picture

FWIW, I tend to use hook_help significantly to document the specific behaviors of modules on various pages. The important point here is that this kind of help is contextual and may contain live data. See for example https://git.drupalcode.org/project/g2/-/blob/8.x-1.x/g2.module#L305 where the help text is complemented by arguments from the current context.

A nice workaround could be if help topics could receive a context provided by some service, maybe defining injection in the frontmatter.

amber himes matz’s picture

A nice workaround could be if help topics could receive a context provided by some service, maybe defining injection in the frontmatter.

I imagine @fgm is not the only one to need this. Sounds like "Allow help topics to get context defined in frontmatter" should be opened as a child issue of this one? @fgm do you want to open the issue, or should I? In either case, I'm interested in more details as to what you are looking for, and if you could provide examples of your modules that use context in their hook_help() implementations. Thank you.

fgm’s picture

@Amber Himes Matz after converting help in G2 help to Help Topics (see https://git.drupalcode.org/project/g2/-/blob/8.x-1.x/g2.module#L305 for the original version, and https://www.drupal.org/files/issues/2023-08-20/3382138.patch for the converted version, still under review) I'm no longer convinced this is so much needed: a single helper providing access to a \Drupal instance would enable access just about any service by calling all \Drupal static methods as instance methods on that instance, and specifically \Drupal::service() thus enabling advanced templates to access just about any service without making the frontmatter more complex.

Still think this is worth a followup ?

andypost’s picture

Looks it need another yaml file to maintain "binding" of topic to routes and paths at least, like menu system doing for local actions and tasks.

Other option is contextual module in core which is also using ContextualLinks render element and manager with alter hook

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.