Closed (fixed)
Project:
Drupal core
Version:
5.x-dev
Component:
help.module
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
14 Oct 2007 at 10:22 UTC
Updated:
30 Oct 2007 at 07:01 UTC
Jump to comment: Most recent file
If you go to the help page of a module that doesn't have any administration pages, you'll get the heading of '@module administration pages' and then no more. (See admin/help/color for an example.)
I see two ways to address this problem:
$admin_tasks = system_get_module_admin_tasks($name);
if (empty($admin_tasks)) {
$admin_tasks[] = t('This module does not have any adminstration pages.');
}
else {
ksort($admin_tasks);
}
$output .= theme('item_list', $admin_tasks, t('@module administration pages', array('@module' => $module['name'])));
$admin_tasks = system_get_module_admin_tasks($name);
if (!empty($admin_tasks)) {
ksort($admin_tasks);
$output .= theme('item_list', $admin_tasks, t('@module administration pages', array('@module' => $module['name'])));
}
I'm not sure which approach I like better, so please chime in! (FTR, both provided code examples have been tested and worked at the time of this writing.)
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | hide_administration_pages_list_d5.patch | 963 bytes | Freso |
| #1 | hide_administration_pages_list.patch | 972 bytes | Freso |
Comments
Comment #1
Freso commentedHaving thought a bit more on it, I've come to prefer option 2. There is no need to show the "administration pages" header at all, if there's nothing to administer. It'll only add clutter and thus possible confusion to the help page. The code is cleaner, too. :)
Patch attached.
Comment #2
JirkaRybka commentedI totally agree, there's no point in showing empty lists, and dummy messages are unnecessary too...
The patch applies cleanly, works as expected, and is simple enough for me to say that it looks OK. So setting RTBC.
Comment #3
Freso commentedAlso, when this has been committed to D6, I'll port it to D5 as I've noticed the same behaviour there, and the fix is most likely just simple. :)
Comment #4
Freso commentedActually, just for the hell of it: Here's the patch for Drupal 5! (To whomever commits this: Please change version to D5 and status to "Patch (CNR)". Thank you.)
Comment #5
gábor hojtsyThanks, committed to Drupal 6.x.
Comment #6
drummCommitted to 5.x.
Comment #7
(not verified) commented