Loading
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:
MapyComCorealready injectsviews.field_data_providerwith a fallback for < 11.2. The bot's outdatedhook_requirementsblock was dropped. - Dropped the bot's
routeplanner.installchange: it duplicated ausestatement, which is a PHP fatal error.
Commit 2: remaining D12 issues
mapycom_requirements()usedREQUIREMENT_*constants, which are removed in D12. The check moved toMapycomRequirementsusing#[Hook('runtime_requirements')]and theRequirementSeverityenum, falling back to ints on < 11.2. The.installfunction is now a#[LegacyRequirementsHook]shim.MapyComCoreTest: method-level@coversreplaced 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