Issue #3604491: Drupal 12 compatibility

Makes user_bundle compatible with Drupal 12, building on the Project Update Bot's automated patch (MR !4 (closed)) but reworked to Drupal coding standards.

Changes

  • Procedural hooks converted to OOP hooks. All hook_* implementations move to src/Hook/UserBundleHooks.php and src/Hook/UserBundleTokensHooks.php as #[Hook] methods. The procedural functions remain as thin #[LegacyHook] delegators so the module keeps working on Drupal 10 (where OOP hook discovery does not exist and the attributes are inert).
  • $view->save(TRUE) deprecation. Both calls in user_bundle.install are wrapped in DeprecationHelper::backwardsCompatibleCall() (save(TRUE) is removed in Drupal 12).
  • UserTypeForm::save() now returns the save status int. EntityFormInterface::save() declares @return int; the override computed $status but never returned it.
  • Token hooks consolidated. The two token #[LegacyHook] wrappers live in user_bundle.module, and user_bundle.tokens.inc is removed (the real implementations are in the OOP hook class).
  • core_version_requirement updated to ^10 || ^11 || ^12.

Note on Drupal 9

This drops Drupal 9 from core_version_requirement (now ^10). The OOP-hook shims and DeprecationHelper rely on 11.1+ / 10.1+ APIs, and Drupal 9 is end-of-life. Shout if D9 support must be retained.

Edited by Andrei Mateescu

Merge request reports

Loading