Problem/Motivation

In #3124762: Add 'lifecycle' key to .info.yml files we added a lifecycle key to info files to communicate when modules are deprecated or obsolete.
However in #3215043: Indicate the non-stable statuses in admin/modules page as we started providing UI elements to go with this, we realised that we need to convey to the user the intended action.

Proposed resolution

Add a new lifecycle_link key to info.yml files that links to a page on Drupal.org with advice for the user.

Remaining tasks

Add support for the key
Add tests

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#5 3225812.patch7.76 KBlarowlan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

larowlan created an issue. See original summary.

Gábor Hojtsy’s picture

lifecycle_description, like the module has a name and description?

catch’s picture

E.g. if forum module was deprecated, the action would be 'Move to the Forum contributed module'

I think it would be good for these to link to a page on Drupal.org rather than directly to replacement modules, this way we can update the documentation page over time without needing to update core. This brings up the question do we always want a custom message, or would a standard message with lifecycle_link key work?

larowlan’s picture

Title: Add lifecycle_message key or similar to info.yml files » Add lifecycle_link key to info.yml files
Assigned: Unassigned » larowlan
Issue summary: View changes

This brings up the question do we always want a custom message, or would a standard message with lifecycle_link key work?

Yeah, that's a much better idea 🧠

Updating the issue summary

larowlan’s picture

Status: Active » Needs review
FileSize
7.76 KB

Added a check to the info parser that this is present and valid for both obsolete and deprecated.

Added text to https://www.drupal.org/about/core/policies/core-change-policies/deprecat... for Simpletest and Entity Reference.

andypost’s picture

+++ b/core/lib/Drupal/Core/Extension/InfoParserDynamic.php
@@ -108,14 +108,23 @@ public function parse($filename) {
+        if (!filter_var($parsed_info[ExtensionLifecycle::LIFECYCLE_LINK_IDENTIFIER], FILTER_VALIDATE_URL)) {

URL validation is tricky, and reminds me about #295021: filter_var() with FILTER_VALIDATE_URL accepts malformed URLs and rejects not all valid URLs

Gábor Hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

@andypost: hm, the sub-issues linked from #295021: filter_var() with FILTER_VALIDATE_URL accepts malformed URLs and rejects not all valid URLs have all been resolved. Not sure what's left of that at this point? Also that less used link protocols are not supported does not really concern this issue IMHO. That would not stop people from being able to assign a docs link.

I think the validation looks good, the tests are comprehensive. UI exposure of the value is in other issues. The requirement for this came from a UX team meeting last week to present this to users as remediation for the warning shown. So IMHO good to proceed.

Ps. the test link looks fun :D

  • catch committed 3726333 on 9.3.x
    Issue #3225812 by larowlan, Gábor Hojtsy, catch, andypost: Add...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 3726333 and pushed to 9.3.x. Thanks!

We need to update https://www.drupal.org/node/3215042 still.

Gábor Hojtsy’s picture

Status: Fixed » Closed (fixed)

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