1

I'm reading Drupal 7 Module Development and trying to learn module development. I've created their example module 'first' and I'm not seeing the 'help' link.

Here is what I have so far...

/sites/all/modules/first/first.info

name = First
description = A first module.
package = Drupal 7 Development
core = 7.x

/sites/all/modules/first/first.module

<?php

/**
 * @file
 * A module exemplifying Drupal coding practices and APIs.
 *
 * This module provides a block that lists all of the
 * installed modules. It illustrates coding standards,
 * practices, and API use for Drupal 7.
 */

/**
 * Implements hook_help().
 */

function first_help($path, $arg) {
  if ($path == 'admin/help#first.') {
    return t('A demonstration module.');
  }
}

Now then... according to this book, when I install/activate the first module, I should see a () Help link to the right of my module name in the Modules admin panel.

I don't. What could be stopping this link from populating this screen. I get () Help links for all of the other modules. But not mine.

I created a subdomain on my server and installed Drupal to test with a fresh Drupal install. The help link shows up and works on the new install. So now I'm trying to wrap my head around what could be killing it on my other Drupal site? Could Devel? Coder? This is very weird.

  • 1
    did you clear your drupal cache? goto admin > performance – Patoshi パトシ Jun 14 '13 at 21:56
  • yea, 1) try clearing cache. 2) the $path should be defined in hook_menu() function of your module (but not necessary to see the linke). 3) in your info file remove files[]= first.module -- its 100% un-needed. – tenken Jun 14 '13 at 22:23
  • I did what you said. If you read my updated question you'll see that a fresh install of Drupal unlocks the issues. So how do I find out which module is causing issues? – randomblink Jun 18 '13 at 13:20
3

You have a period at the end of your path condition.

Try this:

function first_help($path, $arg) {
  if ($path == 'admin/help#first') {
    return t('A demonstration module.');
  }
}
| improve this answer | |
1

A note about modules with more than one-word name: the path must match your module name, if the module was called "first_module" the path "first-module" would not work (underscore vs dash). It should look like this:

function first_help($path, $arg) {
  if ($path == 'admin/help#first_module') {
    return t('A demonstration module.');
  }
}
| improve this answer | |
0

Hope this will help you!!

  • First of all disable the module and enable it again. Also go to Administer > Performance and hit the "Clear cached" button.
    Hope this will resolve your issue.

    If the issues is still there then,

  • If you are using Drupal 7, this link will help you. You can see different examples.

  • After enabling the module clear cache.
| improve this answer | |
0

For anybody else who's having this problem, make sure that the Help module is enabled. That fixed it for me.

| improve this answer | |
0

Enable the Help Module from admin/modules, then refresh page again.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.