Problem/Motivation

Nearly every function can now be oop in a class. Let's track the remaining core module files and sub issues to convert them.

Contribution Guide

If you would like to contribute to this initiative thank you!
There are multiple ways you can contribute.

Reviews

  • Pick an issue that is in needs review
  • Confirm that all api functions are deprecated in 11.5.0 and removed in 13.0.0
  • Confirm that all form / batch callbacks and _ functions are deprecated in 11.5.0 and removed in 12.0.0
  • Constructor parameters can be deprecated for removal / addition in 12.0.0
  • If it is a form callback or underscore function they can be deprecated with no replacement.
  • If there is a replacement check the replacement, if there is no replacement review the reasoning for no replacement.
  • Pull the branch down and run the command git diff main --color-moved=dimmed_zebra --color-moved-ws=ignore-all-space to compare moved code vs changed code.
  • Review the shared change record https://www.drupal.org/node/3522207 to confirm that it is included. (If there is an issue specific CR review that)
  • Add details of your review to the issue in a comment

Code changes

  • Choose a module that does not have an issue
  • Create an issue for that module following the template of on of the issues on this #3567618: Create service for image_path_flush, image_style_options and constant for IMAGE_DERIVATIVE_TOKEN
  • Add the issue to the list in the remaining tasks section so we don't duplicate efforts
  • Ensure this issue is the parent
  • Comment that you are working on it
  • All functions should be deprecated even _ and form callbacks, though those can be deprecated without replacement
  • All functions should be deprecated in 11.5.0 for removal in 13.
  • Constructor changes should be deprecated in 11.5.0 for permanent change in 12.

Scope

Dependency injection should only be added in classes that already have it.
Constructor argument deprecations should be for removal in 12.0.0
If a function is deprecated without replacement, then the code block should remain, just add the deprecation comment and trigger error.

Steps to reproduce

N/A

Proposed resolution

When considering the removal version of a deprecated item, follow the policy from Disruptive deprecations should now be scheduled for removal in Drupal 13.0.0, which states:

(...) disruptive deprecations in Drupal 11.3.x and higher should be scheduled for removal in 13.0.0 (rather than 12.0.0).

Potential cases that can still be removed in Drupal 12:

  • Constructor parameter additions and removals

Remaining tasks

Deprioritized since they are slated for removal

Full list #3466088: [meta] Deprecate dependencies, libraries, modules, and themes that will be removed from Drupal 12 core

No more action needed

User interface changes

N/A

Introduced terminology

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

Comments

nicxvan created an issue. See original summary.

nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
claudiu.cristea’s picture

Should we deprecate the procedural functions being converted? For instance, looking at automated_cron.module which contains the automated_cron_settings_submit() function. Should we assume that a 3rd-party is calling that function? Deprecate or just remove?

claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
nicxvan’s picture

Good questions in 6!

Form callbacks typically don't need deprecation but should use this new pattern https://www.drupal.org/node/3548821 then we don't need to make them static and can use dependency injection.

Underscore usually don't need deprecation either.

But can require deprecation in a case by case basis!

claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
dww’s picture

Issue summary: View changes

Thanks @nicxvan for opening this and to @claudiu.cristea for diving in to move it forward. Per Slack (but posting here for better visibility), I think it'd be better to do 1 issue per module whenever possible, instead of multiple (probably conflicting) issues for separate functions in the same .module file.

Exceptions to the above would include things like update.module (😅😬😊) that still have 500 loc, a big mix of different kinds of procedural functions (some already deprecated, many not), including helper methods, stuff related to fetching update data, and a few other odds and ends. In that case, I'd probably open separate issues for consolidating all the data fetching code into the UpdateFetcher service, another issue for UI-related helper methods, and maybe a 3rd for _update_project_status_sort(). Maybe another for update_storage_clear(). 😂 More or less...

But generally, probably only need 1 issue per .module file.

Thanks again!
-Derek

nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
joachim’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
joachim’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
dww’s picture

I thought we already had #3487962: Review module .inc files post hook conversion for all the .inc files. Seems a bit duplication of effort here. I guess the problem are the cases (always?) where the .module file is what's including the .inc files, so we can't actually remove the .module until all the .inc are gone, too. Still, not sure where to put issues like #3125013: Refactor update.fetch.inc into a MailHandler.

nicxvan’s picture

The issue is that we can address .inc files separately from .module files, but we cannot address .module files without addressing the .inc files.

That means this issue is now a superset so let me close the other one.

nicxvan’s picture

Issue summary: View changes

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

claudiu.cristea’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
smustgrave’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
znerol’s picture

Issue summary: View changes
znerol’s picture

Issue summary: View changes
znerol’s picture

nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Quick stats!

7 issues to be created.
29 merged.
34 issues currently in progress.
4 modules to be removed.

nicxvan’s picture

Issue summary: View changes
znerol’s picture

claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
nicxvan’s picture

Resaving so statuses are correct since a few got in.

claudiu.cristea’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Update current statuses

claudiu.cristea’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

A few things have gotten in, let's bump this for accuracy.

nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

nicxvan’s picture

Issue summary: View changes