From a bug report to bot.module:

hook_help implementations sometimes return an empty string when there is no help - e.g. pathauto_help(), actions_help(), but these get added to the array when hook_help is invoked via module_invoke_all() as in bot.module, resulting in "empty" features being listed, e.g. (22:09:11) Druplicon_tmp: Detailed information is available by asking for "help " where is one of: , Botagotchi, Drupal URLs, Factoids, Function Lookups, Seen. (note the comma at the start of the feature list)

My reply:

This is actually a bug in those modules, not in bot.module. Both actions.module and pathauto.module always preinit $output to '' (as opposed to NULL) and always return $output, regardless if the module help properly fires. This is not something that any of the core modules do, and is bad design. Akismet.module does it also. Whilst I agree that your fix would get rid of these errors, I don't find them MY errors to get rid of - they should be fixed in the source module (and I heartily will support you creating issues in their queues that refer to this explanation).

This particular actions.module bug made its way into Drupal 6's triggers.module.

CommentFileSizeAuthor
#7 trigger_4.patch4.34 KBhazexp
#5 trigger_3.patch4.09 KBhazexp
#2 trigger_2.patch4.47 KBhazexp

Comments

patchnewbie’s picture

Assigned: Unassigned » patchnewbie

This is a great patch for someone new to core development to try.

hazexp’s picture

StatusFileSize
new4.47 KB

I just allowed this to only return $output if any of the $path's are met by the 'case' condition.

Hopefully I did this right :D.

Christefano-oldaccount’s picture

Status: Active » Needs review

Changing status.

morbus iff’s picture

Status: Needs review » Needs work

hazexp - good first patch. Some comments:

* I'd remove the use of $output entirely - just return the generated string.
* Some of the concatenations are using two spaces not one - bring 'em down to 1.

hazexp’s picture

StatusFileSize
new4.09 KB

Made the necessary fixes.

pasqualle’s picture

     case 'admin/help#trigger':
       $output .= '<p>'. t('The Trigger module ...

I think this line does not require concatenation

should be: $output = '<p>'. t('The Trigger module ...

hazexp’s picture

StatusFileSize
new4.34 KB

Whoops, overlooked that. Period characters aren't the easiest to spot :P.

catch’s picture

Status: Needs work » Needs review
ChrisKennedy’s picture

You can just remove the $output from that last line and return the string to be consistent with the other cases.

morbus iff’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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