Problem/Motivation
#3258782: Do not display obsolete modules at admin/modules is removing obsolete modules from the admin/modules page. We'll still see obsolete modules at the admin/modules/uninstall page, which is good, since we should leave site owners a way to manually remove these from their site if needed.
However, obsolete modules have no special warnings or indications on this page. For example, here's a fake scenario where I installed the contrib quickedit module, but marked it obsolete for testing this:
(p.s. you can ignore the baseurl in the address bar, my local really is 9.4.x even though the path says "9_1". 😉)
The same is true for any of the non-stable module status values. They all get special treatment on the "Extend" form. But none of that goodness is shared on the "Uninstall" form.
Steps to reproduce
- Create a 9.4.x core test site.
- Install a contrib module.
- Enable it.
- Edit the .info.yml file to add
lifecycle: obsolete
andlifecycle_link: http://example.com/obsolete
- Visit the /admin/modules/uninstall form.
- Try to quickly spot the obsolete thing you're supposed to uninstall right away to silence the warning on your status report.
Proposed resolution
Add the fancy warnings on /admin/modules/uninstall so any non-stable module looks like they do on the Extend page. E.g. how an obsolete module used to appear:
Perhaps it's also worth moving all such modules to the top of the form? TBD. At least group the obsolete ones at the top? Nah, too much scope creep.
Remaining tasks
Decide exactly how this should look and work.Implement it.Add test coverage.Reviews / refinements.RTBC.Followup to sharing the code block between both core/modules/system/src/Form/ModulesListForm.php and ModulesUninstallForm.php, See #6 and #7.#3270245: Fix translatability and share code for highlighting non-stable extensions between module install, uninstall and theme appearance forms- Commit
User interface changes
Testing of patch in #10 on 9.4.x
Before
After
API changes
None.
Data model changes
Nope.
Release notes snippet
Probably not.
Comment | File | Size | Author |
---|---|---|---|
#18 | 3266397-18.patch | 5.49 KB | quietone |
#10 | 3266397-10-fail.patch | 2.36 KB | murilohp |
Comments
Comment #2
dwwComment #3
dwwAlso marking #3266308 related.
Comment #4
dwwUpdating the summary based on what I posted at #3258782-40: Do not display obsolete modules at admin/modules
Comment #5
dwwExpanding scope to cover all non-stable lifecycle values. The code we want to share handles it all, so the title and summary should reflect that.
Comment #6
benjifisherWe discussed this issue briefly at #3266551: Drupal Usability Meeting 2022-03-04. That issue will have a link to the recording, and it already has a rough transcript.
We did not come up with any firm recommendations, but we do have two (incompatible) suggestions:
For the record, the participants at the usability meeting were
benjifisher, rkoller, AaronMcHale, andregp, Antoniya, ckrina, guilherme-rabelo, guilherme-rabelo, kimberlly_amaral, victoria-marina, shaal, tmaiochi, worldlinemine
Comment #7
quietone CreditAttribution: quietone commentedThe intention of this patch is to highlight the modules on the uninstall page the same as on the install page.
The issue summary suggests grouping all the obsolete modules as well or putting obsolete at the top of the page. That feels like too big a change and a divergence from the install form. That is, would we then want to group deprecated modules on the install form? I much prefer keeping this simple.
As for sharing the code block between both core/modules/system/src/Form/ModulesListForm.php and ModulesUninstallForm.php, this patch does not do that. I started to make a trait but then thought that should be another issue to look at creating something that will work for modules and themes, not just modules.
Comment #10
murilohp CreditAttribution: murilohp at CI&T commentedThanks for the patch @quietone! I was reviewing it here and thanks to @alexpott, there's a way to trick the installation of a deprecated and an obsolete module without creating a new module and of course, avoiding the exceptions during the installation, check: #14.
I've updated the patch with the "trick" and removed the new test modules, let's see if the test pass now.
Comment #11
murilohp CreditAttribution: murilohp at CI&T commentedForgot the interdiff
Comment #12
dwwSweet, just came back here now that #3266308: %extensions placeholder not extension names printed on the Status report warning about obsolete extensions is in and found lots of great progress. Thanks, y'all! Also adding #3266449: Add a link to the Status report warning about obsolete extensions so site owners can fix the problem as related. I kinda think this one should land first, since if we add a link to this page but it's really hard to figure out where the obsolete thing is to uninstall, we haven't improved the UX that much. 😅 When $day_job settles down a bit, I'll give this a close review. Since I haven't yet added any code, I should be qualified to RTBC it...
Comment #13
quietone CreditAttribution: quietone commentedTested with the patch in #10 to get up to date screenshots in the IS. I then successfully uninstalled all three test modules.
And for some odd reason this is not testing experimental on the uninstall form. I reckon that could be added. Setting NW for that
Comment #14
quietone CreditAttribution: quietone commented@murilohp, thanks for change to use config.
Added a test for experimental. None of the existing experimental modules have a lifecycle_link so there is no need to test the link. I guess it could be added but doing so may alter existing tests and I didn't want to go down that route.
Comment #16
dwwI'm not totally thrilled about duplicating the code here instead of reusing from the main modules page, but I hear you in #7 about a follow-up to unify this with the theme code, too. Tagging for the follow-up.
Code review:
I guess we have to depend on the lifecycle_link being defined for this to work at all? I think we have an exception thrown somewhere if you define a non-stable lifecycle without a link, right?
If not, it's too bad this requires a link. It'd still be nice to get a warning icon and something to indicate it's non-stable without needing the link. Probably out of scope. ;)
This is copied from elsewhere, but how can anyone translate these lifecycle terms like this? If all we get is a @lifecycle placeholder that's always forced into the underlying English version, why bother with
t()
at all?Seems like we really want
ExtensionLifecycle::getLabel($lifecycle)
or something that does:This would be another spot to use the
ExtensionLifecycle::getLabel()
method proposed above.Here's a lifecycle_link for "experimental_module_test". I'm confused by comment #14 in the issue and the code comments in the test below...
Update: looks like most of these use http, so we should probably be the same here.
Nit: https? 🤓 (for consistency, and as a general best practice).
Update: Got to the end of the patch, looks like the others are mostly http...
Comment should now include "experimental", too.
Probably irrelevant, but can we chain these and only call
save()
once? E.g., does this work??
I think this comment doesn't match reality anymore. Especially since the assertion is an xpath looking for an
a
tag. Can't this check forhttps://example.com/experimental
too like all the others?Thanks!
Comment #17
dwwFollow-up: #3270245: Fix translatability and share code for highlighting non-stable extensions between module install, uninstall and theme appearance forms. Updating summary accordingly.
Comment #18
quietone CreditAttribution: quietone commented#16. Doing the simplest items for now.
1 - 3. To do
4. See comment below for #8.
5. Now https in obsolete module.
6. Done. I used 'non-stable' for all of them.
7. Yes, that seems to work. So fixed.
8. Oh that is a hoot. The presence of the lifecycle_link in the experimental module is left over from my testing. I did not intend to include that. However, here we are it didn't cause other test failures so let's leave it for now.
Comment #19
quietone CreditAttribution: quietone at PreviousNext commented1. I do like that the lifecycle_link means there is a page where folks can get some more information. I lean more to enforcing that on all non-stable modules, not just deprecated and obsolete. I don't know why it is that way and I have never looked for why experimental does not need a lifecycle_link.
2, 3 Yes, copied from ModulesListForm. Perhaps this is something for another issue?
@dww, And a belated, thanks for the prompt review!
Comment #20
dwwThanks for addressing all that so promptly, @quietone!
1. I like having the link, too. My only point was that it'd be nice if the obsolete warning and icon appeared, even if there was no lifecycle link. But I agree that's out of scope for now.
2-3: I rarely get the scope decisions right. 😅 I think it's currently broken on
ModulesListForm
. We're copying the broken here. We could either:a. Fix it as part of #3270245: Fix translatability and share code for highlighting non-stable extensions between module install, uninstall and theme appearance forms
b. Open yet another follow-up to fix this in
ModulesListForm
, and then depending on when that issue lands relative to this one, we re-roll this one to Do It Right(tm) 😉 or expand the scope of the follow-up to fix it in both places.4-8: Great, thanks!
Comment #21
quietone CreditAttribution: quietone at PreviousNext commentedYour idea, option 2-3a, is the way to go. That is the shared code and it makes to touch it just once.
Comment #22
dwwRe: #21: In that case, re-titled #3270245: Fix translatability and share code for highlighting non-stable extensions between module install, uninstall and theme appearance forms to expand the scope a bit and reclassified as a bug.
I manually tested. Was about to post the after screenshot but realized @quietone already did that in #13.
I don't love committing this with a known bug, but it's an existing known bug and the patch here is definitely an improvement over not having anything to indicate non-stable on this form. We've got the follow-up in place to fix the known bug in both/all places it exists.
Nothing else to complain about with the patch. The summary is up to date and accurate. Hence, RTBC.
Thanks!
-Derek
Comment #23
AaronMcHaleCreated follow-up issue as per comment #7 for promoting non-stable modules to the top of the list:
#3270378: Promote non-stable modules to the top of the list at admin/modules/uninstall form
Comment #25
quietone CreditAttribution: quietone at PreviousNext commentedRandom failure Drupal\Tests\quickedit\FunctionalJavascript\QuickEditFileTest::testRemove
Restoring RTBC
Comment #31
catchThis is because we started with experimental: true some time ago before adding lifecycle/lifecycle_link.
Adding credit for usability meeting participants.
Comment #34
catchCommitted/pushed to 10.0.x and cherry-picked to 9.4.x.
Agreed with handling consolidation and fixing the translation issue in the follow-up.
Comment #35
AaronMcHaleThanks catch!
For anyone keen, this now unblocks #3270378: Promote non-stable modules to the top of the list at admin/modules/uninstall form.