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!
| Comment | File | Size | Author |
|---|---|---|---|
| #67 | core-module-anchors-184010-67-D7.patch | 754 bytes | smussbach |
| #65 | core-module-anchors-184010-65-D7.patch | 821 bytes | smussbach |
| #61 | core-module-anchors-184010-61.patch | 1.19 KB | stefank |
| #58 | core-module-anchors-184010-58.patch | 985 bytes | stefank |
| #54 | core-module-anchors-184010-54.patch | 982 bytes | stefank |
Comments
Comment #1
webchickCheck 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.
Comment #2
catchOK so here's a late night, untested, patch.
Comment #3
catchparse error according to webchick on irc, I'll have another crack in the morning.
Comment #4
webchickSince 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.
Comment #5
webchickLOL. Wrong patch. :)
Comment #6
dwwI 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. :(
Comment #7
catch1) 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.
Comment #8
catchOK 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.
Comment #9
catchComment #10
catchThere's also missing ids for some fieldsets as reported here: http://drupal.org/node/181842
Comment #11
pasquallereroll
it works, and I like it
Comment #12
dww@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.
Comment #13
catchAlready created, but here's the link http://drupal.org/node/184143
Comment #14
dww@catch: Lovely, thanks for the link.
Comment #15
lilou commented#184143: tableheader.js interferes with #anchors in table rows is still active.
Reroll.
Comment #16
cafuego commentedUpdated patch for 8.x, attached.
Comment #17
Elvar commentedUpdate patch, to match path of the latest 8.x.
Comment #18
nod_just want to point out #1440628: [Meta] javascript toolbar/tableheader with url fragment mess that is related to this.
Comment #19
bdone commentedpatch in #17 no longer applies to 8.x.
Comment #20
bdone commentedthe attached patch works for 8.x.
to test, visit the modules page using a module's name as the named anchor.
for example:
Comment #21
nod_Makes #1440628: [Meta] javascript toolbar/tableheader with url fragment mess even more visible, but other than that it's fine with me :)
Comment #22
cafuego commentedI 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?
Comment #23
bdone commenteda d7 patch is attached, if and when it's needed.
Comment #25
bdone commented#23: core-module-anchors-184010-23-D7.patch queued for re-testing.
Comment #27
bdone commentedsorry about the failed d7 patches. didn't realize d8 had to wrap up first. rookie mistake.
Comment #28
bdone commentedback to RTBC per comment #21
Comment #29
catchCan'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.
Comment #30
bdone commentedhere's a patch for D7. is anything further needed to backport?
Comment #31
jibranRelated issue #1892872: Add title attribute to modules administration page
Comment #32
jibranAnother related issue. #1734534: Optionally show the machine names on the permission page
Comment #33
dcam commentedI 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.
Comment #34
sunMoving 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.
Comment #35
sunAttached patch uses
#module-[name]HTML IDs, which also means that these IDs are identical to the Permissions page now.Comment #36
dwwLooks/sounds good to me. Bot's happy. Patch is (obviously) up to standards, etc. ;)
Comment #37
xjmComment #38
seanrI 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.
Comment #39
nod_Last time I checked, nothing in core relied on it. It was recently.
Comment #40
webchickYeah, 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!
Comment #42
klonos...should we do the same in the permissions page (for the same usability reasons since that page gets really long too)?
Comment #43
cafuego commentedSince that currently appears to work via JS, yes I think so. Want to open a new issue?
Comment #44
klonos...sure: #1976152: Add #anchors to permissions administration page
Comment #45
David_Rothstein commentedThere's a Drupal 7 patch in #30, but it needs work due to the subsequent followups.
Comment #46
seanrSee attached.
Comment #47
dcam commented#46 is RTBC. It applies the same basic change from #35, adding a "#module-[name]" HTML ID to checkbox labels.
Before:
After:
Comment #48
dcam commentedComment #49
David_Rothstein commentedThis 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.
Comment #50
seanrAttached patch fixes for D8.
Comment #51
seanrBTW, 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. ;-)
Comment #52
jibran50: core-module-anchors-184010-50.patch queued for re-testing.
Comment #53
znerol commentedNeeds reroll after #1825952: Turn on twig autoescape by default.
Comment #54
stefank commentedOk, here is a reroll.
Comment #55
stefank commentedComment #56
znerol commentedNote, parts of this patch have been committed already (#29, #40). This is the third follow-up as suggested by @David_Rothstein in #49.
Comment #57
alexpottThis has been deprecated - need to use
Html::getUniqueId()instead.Comment #58
stefank commentedOk, 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;Comment #60
znerol commented@stefank: Yes, you also need to add the new
usestatement.Comment #61
stefank commentedThanks. Lets see if that is going to pass.
Comment #62
znerol commentedGreat.
Comment #63
alexpottThis 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!
Comment #65
smussbach commentedD7 Port
Comment #66
znerol commentedMove the call to
drupal_html_id()into theifstatement.Comment #67
smussbach commenteduh, my bad, you are absolutely right.