Change record status: 
Project: 
Introduced in branch: 
11.2.x
Introduced in version: 
11.2.0-beta1
Description: 

The following hooks still support OOP implementations

  • hook_form_alter
  • hook_form_BASE_FORM_ID_alter
  • hook_form_FORM_ID_alter
  • hook_preprocess
  • hook_preprocess_HOOK

The #[FormAlter] attribute has been removed

The #[FormAlter] attribute was added in 11.2.0-alpha1 and removed for 11.2.0-beta1 and beyond.

  • hook_form_alter can still be OOP, use #[Hook('form_alter')] instead.
  • hook_form_BASE_FORM_ID_alter can still be OOP, use #[Hook('form_BASE_FORM_ID_alter')] instead.
  • hook_form_FORM_ID_alter can still be OOP, use #[Hook('form_FORM_ID_alter')] instead.

The #[Preprocess] attribute has been removed

The #[Preprocess] attribute was added in 11.2.0-alpha1 and removed for 11.2.0-beta1 and beyond.

  • hook_preprocess can still be OOP, use #[Hook('preprocess')] instead.
  • hook_preprocess_HOOK can still be OOP, use #[Hook('preprocess_HOOK')] instead.

Changes to the #[Hook] attribute

The PREFIX and SUFFIX constants have been removed from the #[Hook] attribute, there is no replacement. The $hook parameter is required.

Impacts: 
Module developers
Site templates, recipes and distribution developers