Updated: Comment #N

Problem/Motivation

We currently have two kinds of in-Drupal help:

a) Module-level help, which is displayed as topics at admin/help, one per module that defines it via hook_help().

b) Page-level help, which is displayed in the System Help block (by the System module), if it has been defined for a given route (formerly by path but recently changed to use routes) in hook_help().

This setup has a few problems:

1. [Fragility] hook_help() is used to define both types of help, but they're fairly different. We have kind of a hack in place in that hook that uses a fake route to define the per-module help.

2. [weird DX and UI] Type (a) is currently being displayed by the Help module, and goes away if you disable the Help module. While type (b) is currently being displayed in the System Help block, which is part of the System module, and doesn't go away if you disable the Help module. (This is due to historical reasons: it was changed in D7 around 2009, on #240873: Move custom help settings to blocks, for backwards compatibility with how it used to previously work.) But it seems odd to most of us now. See #2261083: Help module help mentions context-sensitive help and shouldn't for one piece of fall-out from this.

3. [weird DX] One hook, hook_help(), is being invoked by 2 different modules, and it is listed under modules/help/help.api.php (so it should be at least moved to System module). See #2263047: hook_help should be moved and should explain how help is displayed

4. [usability bug] Most of the per-page help we have is stupid/useless. If the UI needs explaining, we need a different UI -- we shouldn't be explaining at the top of pages what the UI is about. And conceptual help like maybe "What is a forum container anyway" -- maybe that would be appropriate, but there's not a lot of that happening. See proposal #4 in #2245813: Improve hook_help()

5. [bad DX] When you define help for a route (type B), you do it in the .module file, whereas the code that generates the page is in a Controller. It's too far separated and hard to maintain.

6. [usability bug] The page-level help is not currently displayed when a page is displayed in a modal dialog, so you don't get this possibly valuable information. See #2260095: Help not displayed within modals (like when adding a new block to layout)

7. [fatal error] There are individual implementations of hook_help() whose page-level help assumes that the Help module is available, such as in the Forum module. This is kind of a reasonable developer assumption, but it isn't necessarily true, leading to problems like [2348975] (which is now marked as duplicate of this issue).

Proposed resolution

The proposal that catch and jhodgdon currently prefer is highlighted.

1. Figure out if the page-level help is a good idea or not. Options:
a) Get rid of it, because it's useless.
b) [preferred option] Get rid of most of it, because it's mostly useless. (But this is a separate issue: #2265533: Review page-level help and make sure it's conceptual)
c) Write some useful help that explains confusing concepts for the few pages where that would be appropriate. (Included in #2265533: Review page-level help and make sure it's conceptual)
d) Put in links to the module-level help, which explains confusing concepts. However, be careful because module-level help is only available if the Help module is enabled.

2. If we need page-level help, decide how to define the text. Options:
a) [preferred option] Use hook_help() as we do now. [preferred because it's late to be changing stuff]
b) Move it into the Controller classes somehow as a method, so it's closer to where pages are defined.
c) Have a separate hook.
d) Just output it as markup within a controller's output. Possibly in a collapsed details element or a dedicated "help" element type?
e) Use a Tour instead
f) Use hook_help() but have the System Help block be in the Help module so we don't run into most of the conceptual, fatal, and DX issues mentioned in the summary.

3. If we need page-level help, and it is not just part of the page markup, decide how to display it. Options:
a) Use System Help block (in System module) as we do now.
b) [preferred option] Move the block to the Help module, so if you disable Help you wouldn't have page-level help. This seems like an obvious thing to many of us, but it's not how it works now (for historical reasons).
c) For any of these options, figure out what should happen for modal dialogs, and whether there should be a way to disable it. See #2260095: Help not displayed within modals (like when adding a new block to layout)

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug because at least one of the consequences of this is a fatal error, and there are also some usability problems.
Issue priority Major because at least one consequence is a fatal error, but not Critical because the only known fatal only happens if you have Forum but not Help module enabled.
Prioritized changes This is prioritized because it is a major bug fix and because it addresses usability
Disruption The class name and block ID of the System Help block are changing to "contextual" instead of "system", so install profiles and tests that reference this block will need to have updates, and theme processing will also be different. Also it is in a different module so tests that reference this block will need to have the Help module installed.

Remaining tasks

Make a patch that moves the System Help block to the Help module.

(The rest is other issues)

User interface changes

The System Help block will only be available if the Help module is enabled, which is probably what people expect anyway. The name of the block is changed to Help Block also.

API changes

The help block's module, name, and ID changed.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

jhodgdon’s picture

Issue summary: View changes

Minor/typo edit of summary.

larowlan’s picture

2e use a tour instead?

jhodgdon’s picture

Issue summary: View changes

Good one (#3), added to summary

effulgentsia’s picture

The combination of 1b for most + 2e for the rest, which would make 3 N/A, seems good to me, but would be good to get opinions in here from people who've been involved in Drupal usability studies.

webchick’s picture

Issue tags: +Usability

Tagging for UX team feedback. I do think contextual help is a very useful feature, esp. for custom admin pages. And even within core, it's a simple way to introduce complex terminology to people on the main admin listings. Tour module doesn't really work for me as a replacement, because I might need to click X things to figure out the definition I'm looking for (and after clicking all X of them might find out it wasn't defined for me after all :\) as opposed to quickly scanning 2 sentences. (I also find Tour's help link completely buried and always forget to look for it, but that's a separate issue.)

OTOH, now that there's the "help" region (or whatever it's called), one can create their own custom "system help" block(s) if they wanted to (although it's a much bigger rigamarole). In Olden Tymes™ system help linked off to /admin/help/foo if such a page was defined for the module that defined the current admin listing. With Views this gets much trickier though.

Personally, I don't find the problems in this area particularly compelling enough to start re-jiggering everything when we're in the phase of the release when we're trying to stop changing things just for the sake of changing them. "It's weird" is definitely true, but it's been true since at least Drupal 4.6, so...

webchick’s picture

Btw, we could solve at least 1, 2, and 3 by simply moving the system_help block to the Help module as "help" block and enable it in standard profile, and this wouldn't require changing any module developer-facing APIs.

sun’s picture

#7, moving the help block to Help module, is the absolute minimum for D8 in my book.


Neither the page-level help nor the per-module help page resolves the needs of anyone; it neither provides answers for interested users, nor does it allow developers to educate about the real things that may need explanation.

We should have turned Help module into a dictionary/encyclopedia style Definitions module whose architecture is a definition list a long time ago.

Regardless of page and context, what's needed is the ability to map an arbitrary identifier to a defined term + description. Whether that identifier is a route name or a custom identifier (e.g., "user.role") doesn't matter to Definitions module; it simply maps a given identifier to a definition and returns it.

What that enables is plenty-fold:

Selective help

Placing a help block on a particular page into a custom region to show a specific, preselected definition.

Contextual help in e.g. forms

Rendered and exposed in whichever way you can imagine.

$form['machine_name'] = array(
  // ...
  '#definition' => 'entity.machine_name',
    // What's a machine name? Why should you care? Give good examples?
);
Inline-able + parse-able in text fragments (wiki-style)
Enter the [system path](url.system_path) to link to.
Re-usable

Let's stop to repeat ourselves.

You can create a [view](views.view) to list this content.
Page-level help

Where necessary/sensible, still supports summaries for page-level help. Just point to its definition.

Per-topic help

By design, definitions are list-able per module/topic/category/context in a definition list.

Learn all you wanted to know about Views? There: One definition list on the topic of Views.

In short, remove the hard binding to routes and modules altogether.

Stop adding help where no help is needed. Start to think in definitions. Many definitions. Tailored definitions.

jhodgdon’s picture

Issue summary: View changes

The idea in #8 sounds like Drupal 9 material at this point.

And the idea in #7 of moving the help block to the Help module sounds reasonable... until you start looking at modal dialogs and the solution being proposed there:
#2260095: Help not displayed within modals (like when adding a new block to layout)
(Note: This question is item 3c in the Proposed Resolution already)

So... It sounds like pretty much everyone agrees we should at a minimum review the help text that various modules are providing and see which of it is useful and get rid of the rest. I filed this child issue to do that:
#2265533: Review page-level help and make sure it's conceptual
Whether we do anything else, I don't see a reason not to take that step.

LewisNyman’s picture

@webchick maybe we could use tooltips as a way to introduce complex terminology? We're using one for the shortcut icon right now and there some discussion of using it elsewhere: #2207383: Create a tooltip component

neclimdul’s picture

My 2c. The concept of the help block, maintaining help separate from the controller its describing, makes no sense to me. It leads to outdated information since people forget it exists. Even solving that, the concept that block placement can effectively show any sort of contextually useful information also seems mistaken and a needless complexity.

1) Get rid of page level help (block/those entries from hook_help).
2) Following my feelings on 1), d) show information in the controller and e) use tour(and/or tooltips). b) does sound interesting in that we could do it by allowing a callback that could be shown in a popup when clicking on a placed help link or help icon. Much like the formats help does on text fields. But that is a new and likely complex system and a new feature so I would put it out of scope.
3) see 1)

Antti J. Salminen’s picture

I think the tour module could come closer to being a replacement if it had a view that marked all tips attached to page elements as clickable links. Clicking one would open the tip that has been placed there. Of course that still would not be quite as visible as the current contextual help is.

LewisNyman’s picture

I've also seen a few introductions that show all the tooltips at once, for less linear screens. Both this and a tooltip on hover would be possible after implementation of #2207383: Create a tooltip component

Charles Belov’s picture

There main issue I've noticed in Help in D7 is the long list of non-contextual items when I go to /admin/help in D7 which include, for 98% of staff users, 98% topics they don't have permission to do and no way to identify the 2% they do have permission for.

The Advanced Help which exists for Views in D7 is useful, although more content would be welcome.

jhodgdon’s picture

Please file a separate issue about #14 if you would like to discuss it. This issue is limited to discussing the contextual help that appears as usually a sentence or paragraph at the top of individual admin pages.

catch’s picture

Title: [meta] Should we have top-of-page help and should it be System or Help? » hook_help(): Top of page help sections can't link to help pages without a fatal error or checking for help module
Category: Task » Bug report
Priority: Normal » Critical
Related issues: +#2348975: hook_help(): Top of page help sections can't link to help pages without a fatal error or checking for help module

#2348975: hook_help(): Top of page help sections can't link to help pages without a fatal error or checking for help module was a duplicate in terms of the possible options, but exposed a user-facing fatal error in core. I've marked that as duplicate since this already has the options outlined more clearly.

jhodgdon’s picture

Issue summary: View changes

Adding #16 to the summary.

So we need to make a decision on how to resolve this issue.

I believe that the easiest and most maintainable solution would be to eliminate the System Help block, and move the few bits of top-of-page markup that are actually useful either to the page controller return value itself, or if long, to the module-level hook_help() (and then it may be useful in the Controller to have a "more help" link to the module help, which would only be active if the Help module is enabled).

Any other opinions? How do we make this decision?

jhodgdon’s picture

Issue summary: View changes

Updating issue summary to highlight the proposal catch and I currently prefer.

jhodgdon’s picture

Assigned: Unassigned » jhodgdon
Issue summary: View changes

I discussed this with yoroy and catch today (solicited opinions from Bojhan also, pending).

We came up with a plan, which I'm adding to the issue summary in Proposed Resolution. Also assigning this to myself.

jhodgdon’s picture

Issue summary: View changes

Added beta eval to issue summary.

webchick’s picture

Priority: Critical » Major

I like the conceptual idea of splitting contextual vs. module help, that could also be done in 8.1.x with two new hooks / config entities / whatever and hook_help() left in as a BC layer. And I'd really love to see #2265533: Review page-level help and make sure it's conceptual happen regardless, but jaunting off on a huge quantity of work with an unknown "definition of done" as a pre-requisite of solving a release-blocking bug does not seem like a good idea to me at this juncture.

Fortunately, this is pretty clearly not a release-blocking bug. https://www.drupal.org/node/45111 clearly states that "Issues that have significant repercussions but do not render the whole system unusable (or have a known workaround) are marked major." A fatal error if one module is enabled and another one isn't and you happen to click on a link is not critical. It's major. Workarounds are either enabling the Help module or not clicking the link.

So given that, we should do the least possibly invasive thing we can here, which as far as I can tell is this:

Move the block to the Help module, so if you disable Help you wouldn't have page-level help. This seems like an obvious thing to many of us, but it's not how it works now (for historical reasons).

Or am I missing something?

catch’s picture

Issue tags: +D8 upgrade path

If we move the block, we'll probably need to update block instances once there's an 8-8 upgrade path, so adding tag.

jhodgdon’s picture

Issue summary: View changes

OK I think this is actually a better plan. Summary is updated.

jhodgdon’s picture

Status: Active » Needs review
FileSize
5.62 KB

Here's a patch. Let's see if the bot likes it.

This patch moves the System Help block to the Help module, without changing its ID, and moves a few items of code related to this block from system to help module as well. A few tests now need the help module enabled, because they were placing the System Help block. I grepped through the core directory and didn't find any other mentions of system_help_block, so I think there's a good chance this patch is complete.

One note for reviewers: There are two chunks in system.module that are removed, and you'll notice only one of them is moved to help.module. That is because help_preprocess_block() was already adding the 'complementary' role that system_preprocess_block() was adding. So it was being done twice. Hrmph.

jhodgdon’s picture

FileSize
5.77 KB
326 bytes

Guess I should have at least manually tested that patch first. Small interdiff, should work better. :)

The last submitted patch, 24: 2363359-move-system-help-block.patch, failed testing.

tim.plunkett’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/help/help.module
    similarity index 97%
    rename from core/modules/system/src/Plugin/Block/SystemHelpBlock.php
    
    rename from core/modules/system/src/Plugin/Block/SystemHelpBlock.php
    rename to core/modules/help/src/Plugin/Block/SystemHelpBlock.php
    

    We should rename the class and the plugin ID to not prefix it with "system"

  2. +++ b/core/modules/system/system.module
    @@ -720,10 +720,6 @@ function system_preprocess_block(&$variables) {
    -    case 'system_help_block':
    -      $variables['attributes']['role'] = 'complementary';
    -      break;
    

    This would need to go somewhere.

jhodgdon’s picture

RE #27, In renaming the class... I'm not sure I agree, though, because I still think we want the block to be called "System Help" in the Block UI, since it provides help for the "system". ?? If so, shouldn't the class also be called SystemHelpBlock? In which case I think the plugin ID also makes sense? The patch is also more disruptive if we change the plugin ID.

But if you have a better idea of a name and ID I am not opposed to changing it. I just thought it was more self-consistent this way.

The other part of #27 - item 2 -- this was not needed as described in comment #24, because help.module was already doing the same exact thing in help_preprocess_block() as system was doing in system_preprocess_block() for the help block. So the correct fix was to just remove it from system.

Also as a note I just remembered there is some documentation that needs updating with this patch:

a) The hook_help() API docs need an update and this hook needs to be in help.api.php (I think we moved it to system.api.php).

b) The module help for system and help modules (system_help() and help_help()) need to be updated to say the Help module provides this block, not System.

webchick’s picture

"Contextual Help" block might be more descriptive as to what it's actually doing.

Nice to see the tests passing. :)

jhodgdon’s picture

Good idea. I'll make that change to the human-readable label, along with the class name and ID, and the docs changes.

jhodgdon’s picture

Status: Needs work » Needs review
FileSize
16.07 KB
22.56 KB

OK, here's a new patch. Changes:
- Renamed help block to "Contextual Help", with corresponding changes to class name and ID.
- Moved hook_help() documentation to new help.api.php file in core/modules/help, and revised documentation in that hook header to refer to the new name of the block.
- Moved section from system_help() about the System Help module to help_help(), and revised slightly for the new name of the block. I also moved the closing DL tag to the end of system_help() where it belonged, hope that is OK.

The interdiff might be a bit off for the block class due to the file name change; I recommend checking the patch for actual changes.

I also wrote a change notice, since some profiles and tests may need to change due to the ID change on the block.
https://www.drupal.org/node/2387167

jhodgdon’s picture

Issue summary: View changes

Updated disruption section of beta eval.

jhodgdon’s picture

So... Given that changing the block ID is way more disruptive than keeping it the same... I am wondering if the update in #31 is worth it? I will let the reviewers decide, but take a look at the draft change notice.

catch’s picture

I'm OK with the rename if we can get this in before the upgrade path is supported - it should have very low impact on contrib modules (most install profiles and themes are not porting at this point).

However once we support an upgrade path I don't think it's worth writing an update for.

jhodgdon’s picture

OK, well I think this patch is ready, but it needs a review and then we can get it in. Sooner would be better than later. :)

catch’s picture

Status: Needs review » Reviewed & tested by the community

Looks ready to me as well.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

We need to update the new NodeHelpTest which was added in #2379595: node_help() broken for node add/edit form

jhodgdon’s picture

Assigned: jhodgdon » Unassigned
Status: Needs work » Reviewed & tested by the community
FileSize
23.08 KB
23.08 KB

Good catch! Done. One line interdiff; took the liberty of re-marking RTBC (assuming bot agrees). Also grepped after git pull and this patch, and there are once again no instances of system_help_block in the code base.

jhodgdon’s picture

FileSize
534 bytes

Doh, uploaded patch twice and not interdiff.

alexpott’s picture

So this makes the help text on the Explanation or submission guidelines field (help) of node type a bit interesting. It currently says "This text will be displayed at the top of the page when creating or editing content of this type.". Should this now be a third party setting? There's not much more confusing than adding text here and it not appearing.

jhodgdon’s picture

That particular text should probably be moved to the Node Form controller, or the description for that field should be changed so that instead of "at the top of the page" it explains the text is shown in the help block.

But that text wasn't really any more true before this patch either. Before this patch, if you installed with Standard profile, you'd see the text; you still will with this patch. Before this patch, if you installed with Minimal, you wouldn't see the text, because the Help block wouldn't be placed. The text didn't explain before that "at the top of the page" means "in the Help block", and IMO this patch doesn't make that much worse.

Anyway. If you want I can add something to this patch to clarify that the text appears in the Help block. Or we can boot that to a different issue and fix it right (move it to the Node form controller so it appears no matter what, which I think is the right solution but unrelated to this patch).

webchick’s picture

Agreed that that's a pre-exisitng problem, and we can fix it in another issue with moving the text to the form controller.

tim.plunkett’s picture

+++ b/core/modules/help/src/Plugin/Block/ContextualHelpBlock.php
@@ -16,14 +16,14 @@
+ *   id = "contextual_help_block",
...
+class ContextualHelpBlock extends BlockBase implements ContainerFactoryPluginInterface {

So now instead of having a misleading name prefixed with system.module, we now prefix it with contextual, yet another module? Why not just call it help_block and be done? It is in help.module, after all.

jhodgdon’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
22.79 KB

Fair enough. Here's a new patch, which I (gasp!) made by editing the previous patch.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Thanks.

Bojhan’s picture

Is "The System Help module will only be available if the Help module is enabled, which is probably what people expect anyway." the only interface change?

catch’s picture

@Bojhan yes that's the only change in the interface - the block previously existed all the time, now it's only if help module is enabled.

yoroy’s picture

Good to see this come to a pragmatic solution, lets do it :)

  • catch committed 4cd9d45 on 8.0.x
    Issue #2263359 by jhodgdon: hook_help(): Top of page help sections can't...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Yep. Committed/pushed to 8.0.x, thanks!

Let's still do #2265533: Review page-level help and make sure it's conceptual to get rid of any pointless text that appears in the block.

jhodgdon’s picture

Issue summary: View changes

RE #46/47 - also in the UI, the name of the block became "Help block" instead of "System help block". I updated and published the change notice, and fixed the issue summary.

Status: Fixed » Closed (fixed)

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