As discussed here: http://drupal.org/node/178581#comment-322136 it'd be a useful usability addition to have #anchors for each module on the module administration page. So when linking to the page from help texts etc. users would be taken straight to the module in question instead of the top of what can be a very, very long list - especially with the general trend towards lots of small modules.

No patch - but this needs ids to be added to each table row with a unique ID generated from the module name, probably using a similar mechanism to the edit-status-modulename ids for checkboxes (as a side note we can't link to these because visually it displays the next module down even though it "works").

Attaching to system module, change will have to go in theme_sytem_module. No idea how to make this work but will have a look around later on if I get a chance. Anyone who does know should step in though!

Comments

webchick’s picture

Check out how the permissions page does it.. it also had to do unique IDs for each module, so you can probably re-use at least some of the code.

Nice idea. :) if this is done, it'd be nice to update text in places that refer to enabling/disabling a certain module to point directly to it via the #anchor.

catch’s picture

Status: Active » Needs review
StatusFileSize
new889 bytes

OK so here's a late night, untested, patch.

catch’s picture

Status: Needs review » Needs work

parse error according to webchick on irc, I'll have another crack in the morning.

webchick’s picture

Status: Needs work » Needs review
StatusFileSize
new889 bytes

Since catch is my new Drupal hero for testing the opt-out patch (http://drupal.org/node/178581) so I figured I would try and help with this one. :)

This seems to work... I used the same approach as the access control screen by adding an ID to the table row.

webchick’s picture

StatusFileSize
new913 bytes

LOL. Wrong patch. :)

dww’s picture

Status: Needs review » Needs work

I love the concept. 2 problems with the results, though:

1) (minor) why "#module-book" instead of just "#book" for the anchors?

2) (serious) Apply the patch. Try it out. Go to /admin/build/modules#module-book -- When the page loads, guess what the first module you see is? color.module. Huh? That's right... thanks tableheader.js. :( It's a lovely UI improvement in general, but it sure screws up the potential goodness this patch would be providing. I have no idea what we could do about this, but it basically renders this otherwise lovely idea useless. :(

catch’s picture

1) The idea was to prevent ids starting with an integer.

However, there's no modules on drupal.org that start with an integer, not one. Also it's an administrative page, so I'm not sure how strict about 0.000001% of those pages not validating if anyone ever uploads a module with such a name we'd want to worry about

2) Yeah that's a showstopper.

catch’s picture

StatusFileSize
new902 bytes

OK so that tableheader.js issue is the same on the permissions page, i.e. /admin/user/permissions#module-node

So I reckon it's worth continuing with this issue, and trying to fix the tableheader.js side-effect separately.

New patch attached which makes it just #modulename instead of #module-modulename since the validation issue is only theoretical at the moment.

catch’s picture

Status: Needs work » Needs review
catch’s picture

There's also missing ids for some fieldsets as reported here: http://drupal.org/node/181842

pasqualle’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new902 bytes

reroll
it works, and I like it

dww’s picture

Status: Reviewed & tested by the community » Postponed

@Pasqualle: Please read my 2nd point in comment #6 above. This is a show-stopper problem with this approach.

Until there's a solution that gets tableheader.js out of the way in this case, I think this would be *more* confusing, not an improvement. :( Someone please create an issue about fixing tableheader.js (since yes, it affects other pages, not just this one) and post the link here, so we know what issue we're blocked on. Thanks.

catch’s picture

Already created, but here's the link http://drupal.org/node/184143

dww’s picture

@catch: Lovely, thanks for the link.

lilou’s picture

Version: 6.x-dev » 7.x-dev
Category: task » feature
StatusFileSize
new941 bytes
cafuego’s picture

Version: 7.x-dev » 8.x-dev
Status: Postponed » Needs review
StatusFileSize
new744 bytes

Updated patch for 8.x, attached.

Elvar’s picture

StatusFileSize
new764 bytes

Update patch, to match path of the latest 8.x.

nod_’s picture

just want to point out #1440628: [Meta] javascript toolbar/tableheader with url fragment mess that is related to this.

bdone’s picture

Status: Needs review » Needs work

patch in #17 no longer applies to 8.x.

bdone’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new848 bytes

the attached patch works for 8.x.

to test, visit the modules page using a module's name as the named anchor.

for example:

  • /admin/modules#link
  • /admin/modules#rdf
  • /admin/modules#user
nod_’s picture

Status: Needs work » Reviewed & tested by the community

Makes #1440628: [Meta] javascript toolbar/tableheader with url fragment mess even more visible, but other than that it's fine with me :)

cafuego’s picture

Status: Needs review » Reviewed & tested by the community

I really don't think #1440628: [Meta] javascript toolbar/tableheader with url fragment mess should block getting the anchors into this table. Since core doesn't link to the anchors, core can't mess up the display for users.

Can this be committed and backported to 7?

bdone’s picture

StatusFileSize
new594 bytes

a d7 patch is attached, if and when it's needed.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, core-module-anchors-184010-23-D7.patch, failed testing.

bdone’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, core-module-anchors-184010-23-D7.patch, failed testing.

bdone’s picture

sorry about the failed d7 patches. didn't realize d8 had to wrap up first. rookie mistake.

bdone’s picture

Status: Needs work » Reviewed & tested by the community

back to RTBC per comment #21

catch’s picture

Version: 8.x-dev » 7.x-dev
Category: feature » task
Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs backport to D7

Can't believe I opened this in 2007. Don't think it's a feature request, CTRL-F has been broken on the modules page for years, and this at least provides a way to get to modules without having to go through 30 dependencies first or scrolling up and down.

Committed/pushed to 8.x. Moving to 7.x for consideration.

bdone’s picture

StatusFileSize
new594 bytes

here's a patch for D7. is anything further needed to backport?

jibran’s picture

jibran’s picture

dcam’s picture

Status: Needs review » Reviewed & tested by the community

I tested #30. The patch looks good to me. The same tests described in #20 work in D7 with the patch applied. I'm marking it RTBC.

sun’s picture

Version: 7.x-dev » 8.x-dev
Status: Reviewed & tested by the community » Needs work

Moving back to D8, because this caused a regression: #1919564: Listing for Overlay module's layout changes when viewed within the Overlay

Due to this patch, System module violates the CSS namespaces of other modules.

To wit: User module uses #module-[name] CSS IDs on the Permissions page to avoid this trap. System module should do the same.

sun’s picture

Status: Needs work » Needs review
StatusFileSize
new923 bytes

Attached patch uses #module-[name] HTML IDs, which also means that these IDs are identical to the Permissions page now.

dww’s picture

Status: Needs review » Reviewed & tested by the community

Looks/sounds good to me. Bot's happy. Patch is (obviously) up to standards, etc. ;)

xjm’s picture

Issue tags: +Quick fix
seanr’s picture

I can confirm the fix works, but do we have anything elsewhere in core that relies on these IDs? If so, those will all need to be updated. I'd suggest we either include that here, or at least somehow make note of it.

nod_’s picture

Last time I checked, nothing in core relied on it. It was recently.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Yeah, I thought maybe the Update Manager links at the end did, but they just link to the overall Modules page. Seems like a nice follow-up to fix them.

Committed and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

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

klonos’s picture

...should we do the same in the permissions page (for the same usability reasons since that page gets really long too)?

cafuego’s picture

Since that currently appears to work via JS, yes I think so. Want to open a new issue?

klonos’s picture

David_Rothstein’s picture

Version: 8.x-dev » 7.x-dev
Status: Closed (fixed) » Needs work

There's a Drupal 7 patch in #30, but it needs work due to the subsequent followups.

seanr’s picture

Status: Needs work » Needs review
StatusFileSize
new601 bytes

See attached.

dcam’s picture

StatusFileSize
new2.82 KB
new2.56 KB

#46 is RTBC. It applies the same basic change from #35, adding a "#module-[name]" HTML ID to checkbox labels.

Before:

before.png

After:

after.png

dcam’s picture

Status: Needs review » Reviewed & tested by the community
David_Rothstein’s picture

Version: 7.x-dev » 8.x-dev
Status: Reviewed & tested by the community » Needs work

This is a resuable theme function attached to an alterable form; I'm not totally convinced we know exactly what's being fed into this code well enough to dump it into the HTML unchecked... Shouldn't we be using drupal_html_id() here so we know we're getting a "good" ID in the end?

As an aside, that would probably prevent this from violating any Drupal standards for HTML ID names (for example, it would produce "module-field-ui" rather than "module-field_ui")?

I feel bad bumping this one back, but we can't change the IDs once we get it into Drupal 7... so I think this needs to be finalized first.

seanr’s picture

Status: Needs work » Needs review
StatusFileSize
new965 bytes

Attached patch fixes for D8.

seanr’s picture

BTW, wasn't even aware of that function; I'd rolled my own for themes, so nice to know there's already one I can use for that. ;-)

jibran’s picture

znerol’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs reroll
stefank’s picture

StatusFileSize
new982 bytes

Ok, here is a reroll.

stefank’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
znerol’s picture

Status: Needs review » Reviewed & tested by the community

Note, parts of this patch have been committed already (#29, #40). This is the third follow-up as suggested by @David_Rothstein in #49.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/system/system.admin.inc
@@ -227,7 +227,8 @@ function theme_system_modules_details($variables) {
+    $id = drupal_html_id('module-' . $key);

This has been deprecated - need to use Html::getUniqueId() instead.

stefank’s picture

Status: Needs work » Needs review
StatusFileSize
new985 bytes

Ok, here is a corrected one.
Also, do we need to include the DOMDocument helpers for parsing and serializing HTML strings as
use Drupal\Component\Utility\Html;

Status: Needs review » Needs work

The last submitted patch, 58: core-module-anchors-184010-58.patch, failed testing.

znerol’s picture

@stefank: Yes, you also need to add the new use statement.

stefank’s picture

Status: Needs work » Needs review
StatusFileSize
new1.19 KB

Thanks. Lets see if that is going to pass.

znerol’s picture

Status: Needs review » Reviewed & tested by the community

Great.

alexpott’s picture

Version: 8.0.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

This followup was committed as it is fixing a bug rather than a task. Back to backporting.

Committed 058ca31 and pushed to 8.0.x. Thanks!

  • alexpott committed 058ca31 on 8.0.x
    Issue #184010 followup by stefank, seanr: Add #anchors to modules...
smussbach’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new821 bytes

D7 Port

znerol’s picture

Status: Needs review » Needs work
+++ b/modules/system/system.admin.inc
@@ -2628,9 +2628,11 @@ function theme_system_modules_fieldset($variables) {
+    $id = drupal_html_id('module-' . $key);
...
     if (isset($module['enable']['#id'])) {

Move the call to drupal_html_id() into the if statement.

smussbach’s picture

Status: Needs work » Needs review
StatusFileSize
new754 bytes

uh, my bad, you are absolutely right.

  • alexpott committed 058ca31 on 8.1.x
    Issue #184010 followup by stefank, seanr: Add #anchors to modules...

  • catch committed 99b26ea on 8.3.x
    Issue #184010 by webchick, catch, bdone, Pasqualle, lilou, cafuego,...
  • webchick committed fdebcfe on 8.3.x
    Issue #184010 follow-up by sun: Rename #anchors on modules...
  • alexpott committed 058ca31 on 8.3.x
    Issue #184010 followup by stefank, seanr: Add #anchors to modules...

  • catch committed 99b26ea on 8.3.x
    Issue #184010 by webchick, catch, bdone, Pasqualle, lilou, cafuego,...
  • webchick committed fdebcfe on 8.3.x
    Issue #184010 follow-up by sun: Rename #anchors on modules...
  • alexpott committed 058ca31 on 8.3.x
    Issue #184010 followup by stefank, seanr: Add #anchors to modules...

  • catch committed 99b26ea on 8.4.x
    Issue #184010 by webchick, catch, bdone, Pasqualle, lilou, cafuego,...
  • webchick committed fdebcfe on 8.4.x
    Issue #184010 follow-up by sun: Rename #anchors on modules...
  • alexpott committed 058ca31 on 8.4.x
    Issue #184010 followup by stefank, seanr: Add #anchors to modules...

  • catch committed 99b26ea on 8.4.x
    Issue #184010 by webchick, catch, bdone, Pasqualle, lilou, cafuego,...
  • webchick committed fdebcfe on 8.4.x
    Issue #184010 follow-up by sun: Rename #anchors on modules...
  • alexpott committed 058ca31 on 8.4.x
    Issue #184010 followup by stefank, seanr: Add #anchors to modules...

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.