Unfortunately, litwol fails to understand the meaning of setting a project release to 'unsupported'. I've contacted him multiple times and reset the status of Util 5.1, but no luck.

So, attached patch collapses all fieldsets on admin/build/modules - doing it via JS turned out to be actually the proper and easier way to do this. :)

Missing:
- Configuration setting needed for this?
- JS code should be dynamically invoked by a variable in Drupal.settings to not slowdown performance on all other pages.

Questionable:
- Should only fieldsets containing no selected modules be collapsed?

Comments

sun’s picture

Status: Needs work » Fixed
chellman’s picture

This isn't working for me with the 2.5 release, and it certainly seems like it's supposed to. I'm using the default, 1.0.4 release of jQuery — does this require jQuery Update to work, by any chance?

sun’s picture

Status: Fixed » Needs work

ow... that's possible. We might need to replace [id^="system-modules"] by #system-modules. This code was actually in preparation for #111719: FAPI fails to check auto-generated IDs for uniqueness - XHTML validation fails..

chellman’s picture

StatusFileSize
new578 bytes

Oddly enough, I just tried this, and it worked much better. I've attached a patch that updates this, and also has a regex that checks whether the page we're viewing is, in fact, the module admin page.

sun’s picture

That regex is not needed, because Drupal.settings.admin_menu.tweak_modules is only enabled on admin/build/modules.

chellman’s picture

StatusFileSize
new525 bytes

Re-rolled. I don't even know if it helps for me to do this or not, but I'll do it anyway.

chellman’s picture

StatusFileSize
new549 bytes

It's definitely not helpful to roll the patch with a bug in it. Trying again.

sun’s picture

Joe, do you see a jQuery 1.0.x compatible way for selecting the form id?
I'm running several sites where #111719 actually is guilty for XHTML Strict invalid output. For any reason, also the system_modules form gets a cleaned ID, even though it is only output once on the page. Anyway, that is the reason why I had to use jQuery's attribute regex selector.

chellman’s picture

This seems to work:

$('[@id^="system-modules"] fieldset:not(.collapsed)').addClass('collapsed');

The difference is the @ sign at the beginning. You take a pretty big performance hit doing it this way; Firebug's profiler is giving me around 60ms for the # version, and over 1200ms for the attribute selector version. Still, it does work.

If I read that issue correctly, I guess the patched form.inc is going to give you something like id="system-modules-1"? Because the # version is so cheap, I'd almost be inclined to go with two or three calls that use it instead of the attribute selector version. A hack, yes, but quite a bit faster.

$('#system-modules fieldset:not(.collapsed)').addClass('collapsed');
$('#system-modules-0 fieldset:not(.collapsed)').addClass('collapsed');
$('#system-modules-1 fieldset:not(.collapsed)').addClass('collapsed');

By the way, this is the page where I found the jquery information.

http://docs.jquery.com/API/1.1.2/DOM/Traversing/Selectors

sun’s picture

Status: Needs work » Needs review
StatusFileSize
new726 bytes

ok, if we go that way, does this patch work for you?

chellman’s picture

It does work, yes. And it's nice and snappy.

sun’s picture

Status: Needs review » Reviewed & tested by the community

Great, thanks for contributing.

sun’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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