help? sometimes lists empty features

John Morahan - October 16, 2007 - 21:10
Project:Bot
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:minor
Assigned:Unassigned
Status:closed
Description

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 <feature>" where <feature> is one of: , Botagotchi, Drupal URLs, Factoids, Function Lookups, Seen. (note the comma at the start of the feature list)

#1

John Morahan - October 16, 2007 - 21:20
Status:active» patch (code needs review)
AttachmentSize
bot-help.patch2.22 KB

#2

John Morahan - October 16, 2007 - 21:29

typo

AttachmentSize
bot-help_0.patch2.22 KB

#3

Morbus Iff - October 18, 2007 - 21:30

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).

#4

Morbus Iff - October 18, 2007 - 21:34

This also occurs with the triggers.module of Drupal 6 (which is actions.module in disguise).

#5

Morbus Iff - October 18, 2007 - 21:38

#6

John Morahan - October 18, 2007 - 21:42

I agree it is bad design. I guess the reason it doesn't come up, is that help.module itself doesn't breaks when this happens, due to the unusual ways it invokes this hook.

Okay, off I go to create more bug reports.

#7

John Morahan - October 25, 2007 - 14:21
Status:patch (code needs review)» fixed

This is now fixed in pathauto and actions, still waiting for akismet but I guess nothing more needs to be done here.

#8

Anonymous - November 12, 2007 - 22:42
Status:fixed» closed

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

#9

Morbus Iff - March 5, 2008 - 13:07
Status:closed» active

Reopening. I should probably do this cos people aren't learning.

#10

Morbus Iff - June 23, 2008 - 17:21
Version:5.x-1.x-dev» 6.x-1.x-dev
Status:active» fixed

Fixed in DRUPAL-6--1. Thanks!

#11

Anonymous (not verified) - July 7, 2008 - 17:22
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.