Problem/Motivation
The module uninstall form lists all modules in alphabetical order, this means that non-stable modules are mixed in with stable modules.
In #3266397: Highlight non-stable modules on the admin/modules/uninstall form we are introducing the non-stable statuses for modules on the uninstall form.
During a UX calls it was identified that grouping such modules together at the top of the list would be preferable as it would draw more attention to them. This is particularly important for obsolete modules where immediate action may be required.
In #3266397-7: Highlight non-stable modules on the admin/modules/uninstall form it was agreed to push that change to a follow-up issue, this is that issue.
Steps to reproduce
Proposed resolution
For non-stable modules in the module uninstall list, promote those modules to the top of the list so that they appear first, then all other stable modules appear below in the list.
Remaining tasks
User interface changes
Before

After

API changes
None.
Data model changes
None.
Release notes snippet
Not needed.
| Comment | File | Size | Author |
|---|---|---|---|
| #34 | interdiff_29-34.txt | 3.55 KB | murilohp |
| #34 | 3270378-34.patch | 3.36 KB | murilohp |
| #29 | 3270378-29.patch | 3.5 KB | andregp |
| #5 | 3270378-5-tests-only.patch | 2.3 KB | andregp |
Comments
Comment #2
dwwThanks for opening this to put my idea into a properly scoped issue. 😉
Unrelated in code, but #3205746: Group the available updates report by status, make each collapsible is the same UX principle for the Available updates page. Put the things you actually need to deal with at the top of the page.
Comment #3
aaronmchale#3266397: Highlight non-stable modules on the admin/modules/uninstall form has landed, so this is now active.
Comment #4
andregp commentedI'm working on a patch to place the non-stable modules to the top of the list, preserving their alphabetical order.
I am in the tests part now, I plan to finish it still today.
Comment #5
andregp commentedThis patch looks for all unstable modules and place them above on the list on the uninstall form. It also perform tests to check if the unstable modules appear first.
Comment #7
aaronmchaleThanks @andregp, I haven't tested it myself but it's small and looks good.
Just one thing I picked up on from reading it:
This can be simplified, if we change the
foreachto:Then we have the key so don't need the
array_search()meaning it then becomes:Thanks,
-Aaron
Comment #8
andregp commentedThanks for the review @AaronMcHale!
Here's the new patch. No 'tests-only.patch' this time as it's the same as in #5.
Comment #9
rinku jacob 13 commentedVerified and tested patch#8 on the drupal 9.4.x-dev version. Patch applied successfully and looks good to me.Need +1 RTBC.
Comment #10
aaronmchaleThanks for confirming that the patch works for you @Rinku Jacob 13.
I'm also happy with everything here so moving to RTBC.
Comment #11
dwwGreat, thanks! Added the screenshots to the summary, and hid all the files except the test-only and green patches. I don't think this needs a change record nor a release snippet.
I also reviewed the patch:
My only concern is that part of why this was punted to a separate issue was because of needing to sort out inconsistencies between the main module "Extend" form vs. this uninstall form. Do we need a follow-up for that? Leaving RTBC, and not tagging, but asking just in case. 😉
Crediting @AaronMcHale for writing up & reviews, and myself for the proposal, summary edit, and review.
Thanks again! -Derek
Comment #12
aaronmchaleThanks Derek!
I have a vague memory of discussing that, but don't remember the details. Are we talking purely from a UI perspective or also from the perspective of the underlying code?
Comment #13
dwwI think only UI. The code consolidation aspects of some of this are over at #3270245: Fix translatability and share code for highlighting non-stable extensions between module install, uninstall and theme appearance forms
Comment #15
andregp commentedUnrelated test fail, restoring status.
Comment #16
quietone commentedThis will need to be on 10.0.x now. Added a test for 10.0.x and changing version.
Comment #17
alexpottThis will result in the $uninstallable having a mixed set of keys.
Which in turn will break the following piece of code...
So if one of the unstables modules provided a field that was still being used the checkbox would still be active.
A better thing to do here will change
uasort($uninstallable, [ModuleExtensionList::class, 'sortByName']);to something likeComment #18
aaronmchaleGood spot Alex.
$uninstallable_unstablecould also be index by the module ID.So
$uninstallable_unstable[] = $module;would become$uninstallable_unstable[$module_id] = $module;.Comment #19
alexpott@AaronMcHale - I think we should adjust the sort - as I wrote in #17 - there's no need to sort twice.
Comment #20
alexpottI don't understand why
info[ExtensionLifecycle::LIFECYCLE_LINK_IDENTIFIER])is involved in the sorting. Surely the only thing that matters isinfo[ExtensionLifecycle::LIFECYCLE_IDENTIFIER]?Comment #21
dwwRe #20: 💯, I’ve said the same in other patches. Ever since lifecycle went in, there’s been all this code to only do certain things if the link is defined. I think it’s all weird. The behavior (whatever it is), should happen regardless, and the only thing the presence of the link info controls is if the link is used.
Re #19: fully agree. Simple++
Thanks, and sorry for not spotting this at #11
Comment #22
aaronmchaleOh yeah I wasn't disagreeing with you, it was just something I happened to notice at the time of reading your comment, so thought I'd mention it in any case.
Comment #23
andregp commentedNew patch addressing #17 and #20
Comment #25
andregp commentedI believe the test is unrelated, re-queueing test
Comment #26
aaronmchaleInterdiff appears to address points from #17-21, so I think we're good here.
Comment #27
alexpottThere only needs to be one uasort - the second one should take the place of the first.
Comment #28
andregp commentedAddressing #27.
Comment #29
andregp commentedIt seems that I removed more that I should. Here is the (hopefully) right patch.
Comment #30
aaronmchaleI just tested this locally.
I think we might want to bring back the check for
ExtensionLifecycle::LIFECYCLE_IDENTIFIERthat was discussed in #20 and #21.I enabled HAL and CKEditor 5, HAL is deprecated while ckeditro5 is only experimental, but the result is that CKEditor 5 shows up first (with no link) and HAL shows up second with a link, then the list is sorted as normal.
This just doesn't look right to me; From a user's perspective, looking at this list, with no other knowledge of what is going on here, because experimental modules don't have an associated link, it's unclear why CKEditor 5 is at the top of the list, above HAL.
Coincidentally, I also don't think promoting experimental modules adds any value here. The point of this is to highlight modules where more urgent action is needed, but that isn't really the case for experimental modules (at least not in the same way that it is for deprecated/obsolete modules).
So, either:
Any thoughts? @dww @alexpott
Comment #31
alexpottI think only "only deprecated and obsolete module are promoted." - since this is what you are likely to want to uninstall.
Comment #32
aaronmchaleAgreed, let's put this back to NW.
Comment #33
dwwAgreed. The original intention of my proposal was to promote the things you're most likely to want/need to uninstall to the top. That'd be only deprecated and obsolete, not experimental.
Not sure if I should work on the patch now, or save my RTBC-ability... ;)
Comment #34
murilohp commentedKeep it please hahaha, I was taking a look here and I think I can help, here's a new patch that excludes the experimental and look just at the deprecated and obsolete lifecycles.
Comment #35
aaronmchaleThanks @murilohp!
Confirmed from a visual inspection that the most recent patch by @murilohp is pretty much the same as the previous one by @andregp, with the key difference being, as described, sorting only by deprecated and obsolete.
I haven't tested that patch locally, but I did test the previous one, and since all the tests are passing, I'm happy to give a +1 to it.
@dww if you're also happy with it then I think we're good to go to RTBC :)
I do wonder if we need a change record or something for the release notes though?
Comment #36
smustgrave commentedConfirmed applying the patch #34 is sorting my deprecated modules.
Tested with Activity tracker and Media Library Theme Reset
Think a simple change record would be nice to just announce "hey modules are now sorted differently"
Think this can go to RTBC after that.
Comment #37
murilohp commentedHey @smustgrave, I've added a new CR, moving back to NR.
Comment #38
smustgrave commentedThanks!
Comment #40
lauriiiI don't think issue needs a change record because there is no action required from our users. Users who are interested about changes on this level would likely follow the commits / issue queue.
Committed 642c614 and pushed to 10.1.x. Thanks!
I'm wondering if we should backport this to 10.0.x and 9.5.x. This seems like a low risk usability improvement to backport, but I could see how there could be a very low chance of tripping some automated tests.
Comment #43
lauriiiDiscussed with @alexpott and @catch on Slack and we agreed to backport this to 10.0.x and 9.5.x as a non-disruptive UX improvement.
Comment #44
dwwFabulous, thanks everyone!
Comment #45
aaronmchaleGreat to see this get in! Thanks everyone!