Issue #3628103: Drupal 12 compatibility fixes

Closes #3628103.

The bot's rector patch (made against 59ac3f3) rebased onto current 1.1.x, plus fixes for what it missed.

Commit 1: bot patch, rebased

  • OOP hooks: MapycomHooks, MapycomViewsHooks, RouteplannerHooks, RouteplannerViewsHooks, with #[LegacyHook] shims for Drupal < 11.1.
  • PHPUnit #[Group] / #[RunTestsInSeparateProcesses] attributes on the tests.
  • Conflicts resolved in favour of current 1.1.x: MapyComCore already injects views.field_data_provider with a fallback for < 11.2. The bot's outdated hook_requirements block was dropped.
  • Dropped the bot's routeplanner.install change: it duplicated a use statement, which is a PHP fatal error.

Commit 2: remaining D12 issues

  • mapycom_requirements() used REQUIREMENT_* constants, which are removed in D12. The check moved to MapycomRequirements using #[Hook('runtime_requirements')] and the RequirementSeverity enum, falling back to ints on < 11.2. The .install function is now a #[LegacyRequirementsHook] shim.
  • MapyComCoreTest: method-level @covers replaced with #[CoversClass] for PHPUnit 12.

Tested on Drupal 11.4.11 / PHP 8.4:

  • Unit (11), Kernel (11) and Functional (7) tests are green, with no mapycom deprecations left.
  • Hooks are registered once each, and the status report shows a single "Mapy.com" row.
  • Nodes using mapycom / routeplanner fields render without errors.
  • FunctionalJavascript tests were not run (no chromedriver).
Edited by Pavel Maixner

Merge request reports

Loading
Loading