Problem/Motivation

Profile still uses procedural hooks, annotations and pre-PHP 8 constructors, and it triggers several deprecations that are removed in Drupal 12.

Proposed resolution

Follow what was done for commerce_invoice (#3631741):

  • Move hooks to OOP classes in src/Hook, keeping #[LegacyHook] procedural shims for Drupal 10 compatibility.
  • Move the token hooks out of profile.tokens.inc (autoloading hooks from that file is deprecated in drupal:11.2.0).
  • Replace template_preprocess_profile() (deprecated in drupal:11.3.0).
  • Convert plugin annotations to attributes (@ViewsRelationship, entity types, field plugins, etc.).
  • Use constructor property promotion.
  • Add #[RunTestsInSeparateProcesses] to the functional tests.
  • Require ^10.3 || ^11.

Issue fork profile-3631896

Command icon 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:

Comments

jsacksick created an issue. See original summary.

  • jsacksick committed e945e9af on 8.x-1.x
    task: #3631896 Modernize code: OOP hooks, constructor property promotion...
jsacksick’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.