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.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | trigger_4.patch | 4.34 KB | hazexp |
| #5 | trigger_3.patch | 4.09 KB | hazexp |
| #2 | trigger_2.patch | 4.47 KB | hazexp |
Comments
Comment #1
patchnewbie commentedThis is a great patch for someone new to core development to try.
Comment #2
hazexp commentedI 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.
Comment #3
Christefano-oldaccount commentedChanging status.
Comment #4
morbus iffhazexp - 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.
Comment #5
hazexp commentedMade the necessary fixes.
Comment #6
pasqualleI think this line does not require concatenation
should be:
$output = '<p>'. t('The Trigger module ...Comment #7
hazexp commentedWhoops, overlooked that. Period characters aren't the easiest to spot :P.
Comment #8
catchComment #9
ChrisKennedy commentedYou can just remove the $output from that last line and return the string to be consistent with the other cases.
Comment #10
morbus iffLooks good to me.
Comment #11
gábor hojtsyThanks, committed.
Comment #12
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.