(originally posted here http://drupal.org/node/21191 )

I've just installed the Bookreview module on a fresh install of Drupal 4.6. In administer-->settings--> bookreview, I added under Explanation or submission guidelines the following text:

Thank you for taking the time to review a book!

But when a user creates a bookreview content, the above text appears twice on the submission page i.e.

---
Submit book review

Thank you for taking the time to review a book! Thank you for taking the time to review a book!
---

Am I doing something wrong? Thanks in advance for any advice!

CommentFileSizeAuthor
#2 bookreview_0.patch909 bytesrobertgarrigos

Comments

jeremy’s picture

Project: Book Review » Drupal core
Version: 4.6.x-1.x-dev » 4.6.0
Component: Miscellaneous » help.module

This affects other node modules too. It appears to be a bug in Drupal core. I'm re-assigning this issue to the help.module, where I suspect the problem is.

robertgarrigos’s picture

Project: Drupal core » Book Review
Version: 4.6.0 » 4.6.x-1.x-dev
Component: help.module » Code
Status: Active » Reviewed & tested by the community
StatusFileSize
new909 bytes

This bug has nothing to do with help.module, so I changed that.

This is due, actually, to a redundancy in book review module (it might be also in some others. I have not checked that) within its implementation of the hook_help function, bookreview_help:

    case 'node/add/bookreview':
      $output = variable_get('bookreview_help', '');
      break;

node.module (core module) already handles this in its own implementation of hook_help, node_help:

  if (arg(0) == 'node' && arg(1) == 'add' && $type = arg(2)) {
    return variable_get($type .'_help', '');
  }

I include a patch ready to commit that fixes this with bookreview.module.

Moral: if you write a newmodule that creates a new type of node, don't add the

    case 'node/add/newnodetype':
      $output = variable_get('newnodetype_help', '');
      break;

It might be useful to add a note about this in the hook_help API reference page at drupaldocs.org

deekayen’s picture

Status: Reviewed & tested by the community » Fixed

Committed to DRUPAL-4-6 and HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)