Score:1

hook_help() isn't recognized in my custom module

in flag

I created a custom module in Drupal 9.3.8 which implements hook_help() using code similar to what I have seen in other modules.

This is the relevant code in the node_usage.module file.

function node_usage_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.node_usage':
      $text = file_get_contents(__DIR__ . '/README.md');
      // …
      break;
  }
}

The help text doesn't show up on the Extend page or on /admin/help after I install it. If I call $this->moduleHandler->getImplementations('help') from within the help module, I don't see my module coming up in the list of modules that implements hook_help(). I've tried setting a breakpoint in token_help() in the token module, and it does break there when I clear caches.

Why isn't node_usage_help() invoked?

The module is otherwise working OK and other hooks are invoked.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.