Problem/Motivation
When #3124762: Add 'lifecycle' key to .info.yml files is committed, we will have three new non-stable module states. At present there is a visual affordance to experimental modules at admin/modules. But nothing at present for obsolete and deprecated.
Proposed resolution
Indicate the non-stable statuses in admin/modules page - add a status icon and link the description to the lifecycle link URI.
Provide additional information on the modules confirmation page- including a more information link that leads lifecycle link URI (which will be the deprecated module page on Drupal.org)
Remaining tasks
Review
User interface changes
The modules confirm page now has title 'Are you sure you want to install experimental/deprecated/experimental and deprecated modules?' (depending on what modules are being installed) and lists both experimental and deprecated modules if you attempt to enable modules of either type.

The module listing page has a warning icon and either Deprecated or Obsolete next to the module name if it is one of those statuses. This links to the lifecycle link for the module (a page on Drupal.org with more information).

API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #123 | module-status-revert.patch | 46.85 KB | xjm |
| #78 | 2021-12-10_08-37-22.png | 32.93 KB | spokje |
Issue fork drupal-3215043
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3215043-php73-proof
changes, plain diff MR !1656
- 3215043-indicate-the-non-stable
changes, plain diff MR !1500
Comments
Comment #2
larowlanComment #3
larowlanComment #4
larowlanTaking a dip at this 🤿
Comment #5
larowlanHere's a start
Comment #6
larowlanComment #7
larowlanExperimentalModuleTestis the best spot to add new testsComment #8
gábor hojtsyI know technically this translates as lifecycles not stable are "unstable", but is that the right UI message? Deprecated modules will not receive unpredictable changes for example. I don't have a direct suggestion, just pondering if "unstable" is the right umbrella.
Comment #9
larowlanChanged the language to use Non-stable instead of unstable
Fixed some tests
Comment #11
srilakshmier commentedI am working on this.
Comment #12
srilakshmier commentedFixed the test error from #9. Attaching the updated patch. Please review.
Comment #14
andypostI think both deprecated and experimental has to provide extendibility of UI maybe more places
Kinda status page "counters" (there's already message about experimental exists) about amount of deprecated and experimental modules enabled - telemetry and auto-updates initiatives related
Comment #15
larowlan@andypost please open a related issue for that - good idea for status counters
Patch at #12 fixed the test messages, but was missing the new class
Here, it is
Next step is to refactor
ExperimentalModuleTestto test both experimental and deprecated.Comment #16
larowlanUpdating screenshots
Comment #17
larowlanComment #18
larowlanNow with tests.
This is ready for review in my opinion.
Have flagged for a UX review of the terminology.
Comment #20
catchI think we should say 'may be removed from the next major release of Drupal core', otherwise it seems like this could happen at any moment.
I realise a module could be deprecated two major releases in advance in some situations, for those cases we're probably looking at extra info.yml metadata.
I was actually thinking we'd implement a status report message first since that's the more likely place to warn someone with a deprecated module already installed - is there already an issue open for that?
Comment #21
andypostComment #22
spokjeOnly trying to get tests green, blatantly ignored catch in #20.
Comment #23
larowlanFixes #20
Comment #24
benjifisherUsability review
We discussed this issue at #3225097: Drupal Usability Meeting 2021-07-23.
We would recommend a follow-up issue to update the site Status Report, but #3215045: [Duplicate] Highlight obsolete module's status at admin/reports/status page, providing warning and link with explanation is already there.
We generally liked this feature. The current messages are clear about what the problem is. What they are missing is information on what the site administrator should do about it.
For example, if I am building a site that uses the Forum module, and get a message that it is deprecated, what should I do about it? Or perhaps I already administer such a site and I upgrade to Drupal 9.3.0. Probably the Forum module is being removed from Drupal core but added as a contrib module. In this case, it would be helpful to provide a link to the contrib module.
One place to provide such a link is Deprecated and obsolete modules and themes. That would require an effort to keep that page up to date with a list of extensions that have been deprecated. Another place to provide a link would be on
/admin/modules, next to the Configure and Permissions links. That would probably require yet another addition to the.info.ymlfile.We also suggest another follow-up issue: add an indication of deprecated/obsolete status to
/admin/reports/updatesand/admin/reports/updates/update.Comment #25
gábor hojtsyDocumenting what to do on the drupal.org page sounds useful, I did not even think about that before. I think that is because that assumes we only use this capability for core extensions. Contributed extensions would have a harder time to inform users about replacements.
Comment #26
aaronmchaleIf there's nothing stopping contrib from also making use of this, then I think we should definitely explore the idea of a new
info.ymlkey to provide a link and/or messaging. But yeah, sounds like a follow-up candidate to me.Comment #27
catchA new .info.yml deprecation message key seems the most flexible/contrib-friendly, but agreed if we do that it should happen in a follow-up.
The obvious place to link to from the .info.yml key would be the change record, especially for modules that might have multiple possible replacements, but it would also be a completely new thing (afaik) to link to change records from the core UI.
Comment #28
larowlanI agree it should be a separate issue, I'll open that today and postpone this.
Something like 'Add lifecycle_message key to info.yml'
Comment #29
larowlan#3225812: Add lifecycle_link key to info.yml files
Comment #30
gábor hojtsyThe experimental modules warning links to a docs page which documents all the core experimental modules. I think it would be fine to have the one page that @larowlan created for all core deprecated / obsolete modules for a major release series and document them all there? Conrib could use other docs pages for their specific needs.
Comment #31
daffie commented#3225812: Add lifecycle_link key to info.yml files has landed.
Comment #32
daffie commentedComment #33
catchComment #34
larowlanRework for the new lifecycle_link key
Updated screenshots for the UX team to review
Comment #35
xjmThe title of this issue confused me -- "Promote them? Wouldn't we want to discourage people from using them?" ...so updating the title to describe what the issue is actually for.
Comment #36
aaronmchaleQueued for usability review at #3227759: Drupal Usability Meeting 2021-08-13 or at a future meeting, thanks.
Comment #37
benjifisherWe discussed this issue again at #3227759: Drupal Usability Meeting 2021-08-13.
I am setting the status back to NW for an issue summary update. I think the current patch makes changes to the module page and the confirmation form, but the issue summary only shows a screenshot of the confirmation form. In addition to the screenshots (in the "UI changes" section) it would be helpful to describe all the changes under "Proposed resolution". For example, what is the target of the "More information" link?
In #24, I suggested a follow-up issue to add information to the updates report.
Now that #3225812: Add lifecycle_link key to info.yml files is fixed, non-stable modules can provide a link. I assume this is the target of "More information" in the screenshot. In #24, I also wrote
Has this been implemented? I do not see any mention of it in the comments. The confirmation form is only shown once, when enabling the non-stable module. We should also provide the new link on
/admin/modules. One suggestion from today's meeting is to use a warning icon, the text "Experimental" or "Deprecated", and (iflifecycle_linkis provided) make it a link.We did not discuss it at the usability meeting, but it seems to me that the confirmation page should use complete sentences. This just needs ending punctuation: "The following modules are experimental: Workspaces". I would also make it "module(s)" or use a different string when there is only one. This has a few options: "The forum module is deprecated (More information)". I would say that "The forum module is deprecated" is a full sentence and just needs ending punctuation, and "More information" is not a sentence, so it should not be capitalized.
Comment #38
larowlanIssue summary updates
Comment #39
larowlanAdded the information to the module page
And new screenshot for the confirm page
Comment #40
paulocsFixing CS problems.
Comment #41
benjifisherWe reviewed this issue at #3232405: Drupal Usability Meeting 2021-09-17, and it looks as though all the feedback from #37 has been addressed. Thanks!
If I remember correctly, any change to the UI needs a change record. I am adding the issue tag for that. If I am wrong about this, someone can correct me and remove the tag.
We noticed that the warning icon does not show up when using the experimental Claro admin theme. @ckrina specifically requested that we add a follow-up issue for this rather than handling it as part of this issue. I will add the follow-up later today, unless someone else does it first.
I see that this issue already has the tag for a follow-up. Someone should take care of that.
We also discussed the possibility of grouping deprecated/obsolete modules separately, the way experimental modules already are. That is out of scope for this issue, and there are arguments for and against doing it. Again, I will add an issue for further discussion unless someone else does it first.
Do we already have issues to deprecate some modules and add the
lifecycle_linkkey to their.info.ymlfiles? If so, can we add them as related issues (or add this issue to them)?Comment #42
larowlanThe follow-ups are already children of the parent, i.e siblings of this issue
#3215044: Promote the non-stable statuses in admin/appearance page, optionally even visually and #3215045: [Duplicate] Highlight obsolete module's status at admin/reports/status page, providing warning and link with explanation
Added a change record
As this blocks our plans to deprecate some core modules before D10, marking as major
Updating issue credits
Comment #43
larowlanNew title
Comment #44
benjifisherI added follow-up issues as promised in #41:
Comment #45
phenaproximaI know the UX team has already reviewed this issue, but: would it make sense to display the deprecation status even if there isn't an informational link?
I don't normally see this pattern in core, but I like it, because it reduces constructor boilerplate (and, for that matter, constructor deprecations). 👍
Not a big deal, but
array_reduce()feels like a strange way of doing this. Why not a simpleforeachloop, separating the modules into distinct $experimental and $deprecated arrays? IMHO that would be easier to follow.Would this message also be shown for non-core modules? If so, should we adjust the wording here?
Should this be "Non-stable" (note the hyphen) for consistency with other user-facing language?
Rather than rely on a CSS selector for this, which ties it closely to the way it's rendered, IMHO we should split it into two assertions. Something like:
Come to think of it, shouldn't the link text be something like "View information on the deprecated status of status of the Deprecated module"? We should probably assert that the full text is there. (If I'm reading this correctly, the use of the :contains pseudo-class means we're not checking for this.)
Do we have test coverage of installing both experimental and deprecated modules at the same time?
Why not assert the full text of the link, rather than a subset?
Can I just say that I love all these comments? They make it super clear what we're testing, and why, and what we expect. ❤️
Comment #46
larowlan#45.1The info parser throws an exception if you have a deprecated/obsolete status without a deprecation link so we don't need to handle that scenario
#45.2I think I should remove that, it prevents constructing the form without a container. It's great for contrib (to prevent deprecations) but that's not an issue in core. Old habits from dayjob die hard.
#45.3I disagree, but its a personal preference and I can choose another hill to die on, will fix
#45.4Good pickup
#45.5Sure
#45.6Yes, although pretty sure the 'named' selector is an inexact match
#45.7Sure, can add
#45.8Can do, just wanted to avoid whitespace issues
#45.9I think they're Ted's work from the existing code :)
So in summary, 2-8 are actionable
Comment #47
larowlanFixes 2-8 of #45
Comment #48
yogeshmpawarThis will resolve custom commands failures.
Comment #49
dwwThanks everyone, this is mostly looking good. However, I have some concerns before I could RTBC this:
Given that experimental modules don't define a lifecycle_link, this means there's no visual indication of experimental modules on this page.
By convention, core experimental modules use a separate:
package: Core (Experimental)in their .info.yml files, but contrib isn't necessarily going to get the same treatment.Seems like the intention of this issue would be to add an indication of what's experimental, even in contrib. Should we at least put the warning icon, "Experimental" and a link to https://www.drupal.org/about/core/policies/core-change-policies/experime... in the module-specific links (next to permissions link, etc) or something?
Unless there's something magical about inline Twig templates I don't understand, it doesn't seem that any of this text is translatable.
Agreed with #45.4 that this would appear for contrib, too. But this version still seems a little clumsy / awkward.
We know if a given module is core or not. Is it too much complication and trouble to use that knowledge right here to customize this text depending on what's actually being enabled?
If that's too much hassle, can we do something about "Deprecated modules are modules that may be removed from ... the relevant contributed module."? Modules removed from a module? Huh? I know "project" is a hyper-loaded term, and we don't use it much in the admin UI (although we'll see it a lot more if #3012004: Add a link to the module's drupal.org project page in the module admin page lands). But I believe "Deprecated modules ... may be removed from ... the relevant contributed project." would be easier to understand. But I'm probably too much of an "insider" to say for sure.
Needs a "the" after "that".
Should we also do:
here?
And the same as above but assertTrue()?
There are a bunch of other spots in this test where we could do something similar, if this is worth the trouble.
If we change this above, we'll need to update it down here in these spots, too.
As a new test method, aren't we starting with a clean install here? Why do we need to uninstall anything first?
Comment #50
dwwp.s. This isn't just for sighted users. The indication might be visual or audio or both. 🤓
Comment #51
dwwConfirmed #49.8 locally, that's unneeded. Also fixed nit 49.4. Everything else in 49 I'd prefer to get someone else to verify before I start changing anything. 😉
Thanks!
-Derek
Comment #52
larowlan#49.1 I'd like to punt to a follow-up. The pressing need here (why this is major) is so we can deprecate forum/hal/quickedit/aggregator and bartik
#49.2 Will fix, great pickup
#49.3 how would we handle the scenario if the modules being enabled span both contrib and core? Show two messages?
Comment #53
larowlan#49.5 and 6 I think that could be a follow-up too, as there are quite a lot of existing places in this test that work that way, so that would keep it the scope tighter here.
Fixes #49.2 and 3
Wondering if you're OK to punt 1, 5 and 6 to a follow-up.
Comment #57
larowlancrediting @fubarhouse @quietone and @kim.pepper who worked on this with me during DrupalSouth
Comment #58
andypostneeds to fix CS
Comment #59
quietone commentedJust doing the coding standard fixes.
Comment #61
larowlanFor forum.info.yml changes weren't supposed to make it into the patch, whoops
Comment #62
larowlanSomehow d.o ate my patch file 🤔
Comment #63
larowlanAh, a .ptach file isn't the same as a .patch file 🤦♂️
Comment #64
phenaproximaPretty sure this is a Klingon curse word.
Comment #65
catchNice that we can remove this.
I'm not sure non-stable is a great description of either deprecated or experimental modules.
At first I was going to suggest we use 'unstable'.
Thinking more about it, could we build this dynamically similar to::buildMessageList() and say 'experimental', 'deprecated', or 'experimental and deprecated' and skip having to choose a word altogether?
Comment #67
spokjeBack to Needs work for #65.2.
Also taking the opportunity to given an honourable Made-Me-Giggle mention to #64:
Comment #68
spokjeUsed 3215043-60.patch as base for the new MR on 9.4.x-dev
Comment #70
spokjeComment #71
quietone commentedI did some manual testing, I did not look at the code.
According to Info files can now contain 'lifecycle' and 'lifecycle_link' keys to convey the stability of a module/theme the lifecycle_link property is required for 'deprecated and obsolete'. I was surprised to find that it was ignored for stable where for the other three lifecycles it was added.
Without a lifecylce_link there are failures.
lifecycle: obsoleteorlifecycle: deprecatedresults inThe website encountered an unexpected error. Please try again later.The log was:NOTICE: PHP message: Uncaught PHP Exception Drupal\Core\Extension\InfoParserException: "Extension test (modules/contrib/test/test.info.yml) has 'lifecycle: obsolete' but is missing a 'lifecycle_link' entry." at /var/www/html/core/lib/Drupal/Core/Extension
lifecycle: experimentaldid not fail. The display was as if it was stable.lifecycle: stabledid not fail.Having this in test.info.yml did not generate a warning, perhaps it should?
Comment #72
spokjeAddressed #65.2.
Non-arguably not my best work, but at least it gets the ball rolling again.
This issue (and #3215045: [Duplicate] Highlight obsolete module's status at admin/reports/status page, providing warning and link with explanation) are blockers to deprecate Core modules now and make them obsolete in D10, so I'd like some eyes (and movement) on this :)
Comment #73
spokjeThe observations from @quietone in #71 seems valid to me, but also seem out of scope for this particular issue. Should a follow-up/separate issue be created for these?
Here's hoping some Big Brains can answer that as well.
Comment #74
quietone commented@Spokje, thanks. I retested without this patch and same results, sorry for the noise here. I have created a new issue for my findings, #3253501: Handle modules that do not provide a required lifecycle_link property.
Comment #75
quietone commentedUsing the UI I enabled an experimental module. The title of the confirm form uses the plural form, "Are you sure you wish to enable experimental modules?". It was a bit jarring so I wonder if it can be changed to show the singular/plural as needed?
Comment #76
quietone commentedThe change record needs an update too. The confirm message has changed and the link is shown for experimental as well.
Comment #77
spokjeComment #78
spokjeAs Kermit already explained: It's not easy being (or indeed getting back to) green...
Finally got there.
Thanks to @quietone for noticing #75 and #76
Singular/Plural should be fixed in the latest MR.
I've also changed the CR to reflect the confirmation message is now mentioning experimental as well and upped the introduced in.... fields to 9.4.
Comment #79
spokjeComment #80
catchMoving to needs work for the translated string issues in the MR, however didn't see anything else much to complain about.
Comment #81
gábor hojtsyI checked with translation string issue you mentioned. That looks legit. Also, are we using heavy "visually-hidden" and other classes in trasnlatable strings elsewhere in core? This and friends look like some quite heavy specific markup for a translation string:
Comment #82
spokjeThus spoketh @Gábor Hojtsy in #81
Looks like the inspiration came from here: https://git.drupalcode.org/project/drupal/-/blob/9.3.x/core/modules/system/src/Form/ModulesListForm.php#L284?
The fact that the translation string Gábor mentioned breaks into two visually-hidden parts makes the markup double as heavy, but as the above link show, it isn't unheard of in Core.
Is it something we want to promote/use here? I'll leave that to Big Brains to decide.
Comment #83
spokjeUpdated CR in #78, so removing that tag.
Comment #84
gábor hojtsyRe #82, that snippet is much lighter:
$this->t('Configure <span class="visually-hidden">the @module module</span>', ['@module' => $module->info['name']]),vs in the MR
$this->t('@name (<a href=":url" class="module-link--non-stable"><span class="visually-hidden">View information on the </span>@lifecycle<span class="visually-hidden"> status of the @name module</span></a>)', []);I don't have bright ideas for breaking this up though, that would be confusing to translate as well even if much less markup. It would probably be good to at least remove the link. Something along these lines:
$name . ' (<a href=":url" class="module-link--non-stable">' . $this->t('<span class="visually-hidden">View information on the </span>@lifecycle<span class="visually-hidden"> status of the @name module</span>', []) . '</a>)';Or would the explanatory text not fit better in a title attribute on a span around @lifecycle?
Comment #85
larowlanCould we add a theme hook for it and use the trans twig filter on the individual strings ,could even be an online template
Comment #86
gábor hojtsyNo sure, if you meant that, but we definitely should not do half sentences,
"View information on the"is not a string that someone can translate :) So I don't think we need to break up that much, but it would be good to not have excessive markup in translatable text. So if we can meet somewhere in the middle that would be great.Comment #87
spokjeTrying to implement the middle ground
Comment #88
spokjeWould this solution work?
Comment #89
catchLooks good to me now - leave it up to Gábor whether it resolves the markup heaviness enough.
Comment #90
gábor hojtsyThe title attribute solution looks much better for translatability. I am not knowledgable in accessibility enough to be authoritative on whether this is on par with the inline text marked visually hidden, but I believe it is.
Comment #91
spokjeI hate to see this issue sitting around in a dormant state until an accessibility expert happens to come by.
Would this be something to use the "Needs accessibility review" tag for?
Or would the original idea of Gábor of using a span which is visually hidden, wrapping the link text and containing a title with one translatable string (the same as the current a-tag has) be sufficient to appease everybody?
Comment #92
larowlanI'll test it with voiceover in the coming week
Comment #93
larowlanAccording to the very useful https://www.smashingmagazine.com/2021/12/designing-better-links-websites... we should use aria-label instead of title
Comment #94
spokjeThanks @larowlan, I've stumbled over a link that states aria-label as the way to go as well: https://www.deque.com/blog/text-links-practices-screen-readers/
Updated MR to use aria-label and merged latest commits on
9.4.x-devas well.Comment #95
catchOne more comment on the string in the MR - don't think we can concatenate within the placeholder.
Comment #96
spokjeComment #97
catchWas wondering whether it was possible to build the link markup with Drupal\Core\Link or the equivalent render element but it's not - can't do the custom classes like we have here.
Translatable strings look fine to me now, and seems like the least worst trade-off of translation context vs. markup in the string.
Moving to RTBC.
Comment #98
gábor hojtsyUpdate related issues.
Comment #99
catchThat'll teach me to RTBC things after 9pm - we can add the classes with the $attributes argument to URL if we use Link::fromTextAndUrl(), that'd save a lot of string concatenation then.
Comment #100
spokjeComment #101
catchThat looks great.
Comment #102
larowlanThanks for keeping this moving @Spokje - just a couple of minor things I think we need to still address
Comment #103
xjmComment #104
xjmComment #105
catchComment #106
spokjeAppreciate the enthusiasm, but lets not get excited now...
Comment #107
spokjeOne thread still open. I'm not able to figure it out.
Comment #108
spokjeComment #109
spokjeResolved all threads.
Comment #110
spokje- Re-resolved all threads (thanks @catch)
- Merged latest commits on
9.4.x-devComment #111
catchI think that resolves all of @larowlan's points, moving back to RTBC.
Comment #112
andypostLast changes are rebase, so rtbc+1
Comment #113
spokjeAs @catch said in the sibling issue #3250585-40: Highlight deprecated modules and themes at admin/reports/status page, providing warning and link with explanation:
Comment #114
gábor hojtsyI re-reviewed the changes and I agree it looks ready to be committed.
Comment #117
catchCommitted/pushed to 10.0.x and cherry-picked to 9.4.x, thanks!
Comment #119
mondrakeThis broke 9.4 testing on PHP 7.3 due to typehinting a class property
Comment #121
spokjeNew MR should be even PHP 7.3 proof...
Comment #122
larowlanTest bot is happy, change looks good
Comment #123
xjmI think this may have broken HEAD on PHP 7.3. Uploading a patch of a revert to see if it will fix HEAD.
Comment #124
xjmlol I had not reloaded the tab. I'll commit this.
Comment #126
xjmCommitted the hotfix to 9.4.x. (I left 10.0.x alone since it requires PHP 8.0.) Thanks!
Comment #127
xjmComment #130
AlirezaK commentedLine 266 in buildrow() assigns string value to class attribute, where it should be a an array. Issue #3307972 created!