When i try to install taxonomy_html or taxonomy_dhtml (both CVS) into Drupal CVS, module's name is blank at ?q=admin/system/modules (module's description is OK) and their respective blocks don't show at ?q=admin/system/block

Comments

mikeryan’s picture

I ran into this problem as well in 4.3.0, and figured out there were two problems involved here. One is a precedence issue in system_listing(), when setting the name of a module being loaded for the first time. A pair of parens helped there:

$info->name =
module_invoke($file->name, "help", "admin/system/modules#name") ?
module_invoke($file->name, "help", "admin/system/modules#name") :
(module_invoke($file->name, "system", "name") ?
module_invoke($file->name, "system", "name") : $file->name);

But that's not enough, because the help hooks in those modules don't look at the $section parameter, they just return the description in all cases. The fix for taxonomy_dhtml:

function taxonomy_dhtml_help($section) {
switch ($section) {
case 'admin/system/modules#name':
$output = "taxonomy_dhtml";
break;
case 'admin/system/modules#description':
$output = "This module provides a DHTML representation of this site's taxonomy. Currently, a ". l("block", "admin/block"). " is provided for each vocabulary as well as an ";
$output .= l("overview", "taxonomy_dhtml");
$output .= " page showing all vocabularies, terms, and recent nodes within each term. Finally, a box showing taxonomy feeds is outputted on the ". l("syndication page", "syndication"). " if syndication.module is installed.";
break;
}
return $output;
}

I think the module_help doc should mention that it will get called with those arguments when the module is first loaded, although the example there will work fine (if you return empty strings in those cases, the code will default to the system hook results).

dries’s picture

mikeryan’s picture

Yep. I'm new here and wasn't expecting to be contributing so quickly, but I've read up on the Developer's Guide and applied for contribution access. For now:

Index: drupal/modules/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system.module,v
retrieving revision 1.105
diff -u -r1.105 system.module
--- drupal/modules/system.module 9 Nov 2003 01:22:40 -0000 1.105
+++ drupal/modules/system.module 9 Nov 2003 17:06:40 -0000
@@ -297,7 +297,12 @@
foreach ($files as $filename => $file) {
include_once($filename);
if ($type == "module") {
- $info->name = module_invoke($file->name, "help", "admin/system/modules#name") ? module_invoke($file->name, "help", "admin/system/modules#name") : module_invoke($file->name, "system", "name") ? module_invoke($file->name, "system", "name") : $file->name;
+ $info->name =
+ module_invoke($file->name, "help", "admin/system/modules#name") ?
+ module_invoke($file->name, "help", "admin/system/modules#name") :
+ (module_invoke($file->name, "system", "name") ?
+ module_invoke($file->name, "system", "name") :
+ $file->name);
$info->description = module_invoke($file->name, "help", "admin/system/modules#description") ? module_invoke($file->name, "help", "admin/system/modules#description") : module_invoke($file->name, "system", "description");
}
elseif ($type == "theme") {

and... it looks like taxonomy_dhtml.module has already been fixed in CVS (I had installed the tar.gz off the Downloads page). Didn't bother with taxonomy_html, since it's deprecated in favor of taxonomy_dhtml anyway...

Ben Burner’s picture

I seem to have the same problem with other modules, too - even if they were made for 4.3, like the image module.
You can see an example from my configuration page: http://drupal.org/node/view/3616
I upgraded from 4.2rc to 4.3. Since I do not want to update to CVS, your fix doesn't probably help me, would it?
Cheers!

- Ben

Ben Burner’s picture

Please kick me. The correct url to the screenshot is http://smallbrainer.de/misc/screenshot.jpg

- Ben

mikeryan’s picture

That looks like the same symptom - the image module has an image_help() function which does not respond to admin/system/modules#name. A quickie fix for affected modules if you aren't comfortable applying the patch I provided is to comment out the _help() function.

Hope that helps...

Ben Burner’s picture

I haven't tested your solution yet, but another temporary solution is to manually add the describtions or the title using a sql tool like phpmyadmin. It's in the table "system". Downside - you'll have to repeat it everrytime you activate or deactivate a module.

Ben Burner’s picture

Your fix really helped.
Whyever, the #name thing was missing in several of my modules.
After adding it and deleting coresponding translations, uploading them again, everything just was fine.
Thanks!

Kjartan’s picture