[policy and meta] Provide a proper mechanism for deprecating modules and themes

Created on 9 May 2020, about 4 years ago
Updated 22 April 2024, about 2 months ago

Problem/Motivation

We don't have a formal way to deprecate modules in core. In #3062281: Deprecate block_place module for removal in Drupal 9 β†’ , we deprecated the Place Block module by deprecating basically everything inside it, including the .module file itself. The module had already been hidden in a previous minor release. It was a bit tedious and ad-hoc, and took a long time to implement even though we were deprecating a module that had been already hidden for many releases.

This issue is not for defining the conditions under which a module will be deprecated; that's a separate product management discussion. Rather, it's for discussing how to deprecate a module once the decision has been made to do so.

Proposed resolution

Use the lifecycle property in the info.yml of the module to deprecate and eventually remove the module from Drupal core. To deprecate a module change the lifecycle property to lifecycle: deprecated and add lifecycle_link: link to CR, In the next major release change the lifecycle property to lifecycle: obsolete and add lifecycle_link: link to CR. Also add an update to uninstall the module.

There are two possible scenarios:

  1. The module is being moved to contrib for future major versions
  2. The module has no replacement because its functionality has been moved into other modules or APIs (Example: #3111645: Uninstall entity_reference module and prevent it being enabled again, remove deprecated code β†’ )

What happens as a result will depend on which of these scenarios are the case.

  • There should be a requirements warning for both install and runtime.
  • If the module is not being moved to contrib, its APIs should be deprecated.
  • If a contrib replacement is being created, the Composer faΓ§ade should somehow be able to resolve the core module versus the contrib module (whether based on version, project sub-namespacing, or some other mechanism) and the messaging should explain the correct actions to take.
  • Modules that have the deprecated module as a dependency should also receive a warning.
  • Composer projects that declare a dependency on the module should also receive a deprecation warning and recommend the replacement.
  • Automated tooling like Upgrade Status should detect and warn the user about the deprecated module.

Remaining tasks

  1. #3188544: [policy discussion] Address Composer namespacing issues when extensions move between core and contrib β†’
  2. Can rector or Project Update Bot do anything with this, e.g. replace a dependency on a deprecated extension with its replacement or contrib equivalent?
  3. Done. Update Drupal deprecation policy β†’ to include modules and themes.

Completed child issues

  1. #3124762: Add 'lifecycle' key to .info.yml files β†’
  2. #3215043: Indicate the non-stable statuses in admin/modules page β†’
  3. #3250585: Highlight deprecated modules and themes at admin/reports/status page, providing warning and link with explanation β†’
  4. #3223453: Check for uses of deprecated and obsolete projects based on the lifecycle info file key β†’
  5. #3257127: Trigger a deprecation message when a deprecated module or theme is enabled β†’
  6. #3215044: Promote the non-stable statuses in admin/appearance page, optionally even visually β†’
  7. #3258782: Do not display obsolete modules at admin/modules β†’
  8. #3265362: Do not display obsolete themes at admin/appearance β†’

User interface changes

TBD

API changes

TBD

Data model changes

TBD

Release notes snippet

TBD

🌱 Plan
Status

Active

Version

11.0 πŸ”₯

Component
ExtensionΒ  β†’

Last updated 3 days ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States xjm

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024