Problem/Motivation
Drupal 12 requires PHP 8.5 and PHPUnit 12.5. The 2.x series runs next-major CI jobs against Drupal 12, allowed to fail, but until this issue they stopped at the Composer step, so no test had run on Drupal 12.
Project Update Bot never opened an automated compatibility issue for this project, because its analysis fails at composer require drupal/mongodb: its Drupal 11 run reports ext-mongodb as missing from its environment. This issue takes its place.
Proposed resolution
Done in earlier issues:
- PHP 8.5: extension 1.x does not build on it, so Drupal 12 needs the 2.x driver, supported since #3542043: Allow compatibility with `ext-mongodb` version 2.0.
- The implicitly nullable parameter that failed a test on PHP 8.5: #3458044: [PHP 8.4] Fix implicitly nullable type declarations.
- The PHP 8.5 deprecations in
QueueTest: #3626726: Ensure PHP 8.5 compatibility. - Composer:
drush/drushinrequire-devalready accepts^14, the only Drush that accepts Symfony 8. No PHPUnit constraint turned out to be needed: the next-major Composer job installs Drupal 12's.
Done in MR !55:
- Core requirement:
core_version_requirement: ^12.0 || ^11.3 || ^10.6in all four.info.ymlfiles, test module included. - Tests, since PHPUnit 12 no longer reads annotations:
- Attributes (
#[CoversClass],#[Group],#[DataProvider]) beside the annotations, which PHPUnit 9 still reads on Drupal 10. @coversDefaultClassbecomes a class-level@covers, and method-level@covers ::methodare removed: PHPUnit 11 reports them as invalid once a class has attributes, and PHPUnit 12 has no method-level targets.#[RunTestsInSeparateProcesses]on every concrete kernel and functional test class: deprecated without it since Drupal 11.3, an exception in Drupal 12.0 (change record).ControllerTestno longer callsxpath(), deprecated in Drupal 11.5 (change record). It calls Mink'sfindAll()directly, which works the same on Drupal 10 to 12.
- Attributes (
- Requirements: Drupal 11.3 deprecates procedural
hook_requirements()without#[LegacyRequirementsHook](change record), and Drupal 12 removes theREQUIREMENT_*constants.- Runtime and update checks move to OOP hooks in
src/Hook/, and install checks toInstallRequirementsInterfaceclasses insrc/Install/Requirements/. - The procedural
hook_requirements()remains as a#[LegacyRequirementsHook]wrapper, so Drupal 10 runs the same checks. - A
Severityhelper maps severities to theRequirementSeverityenum or to the constants, depending on the core version.
- Runtime and update checks move to OOP hooks in
- Bugs fixed on the way, in the requirements checks:
- MongoDB errors and warnings were reported as OK on the status report.
- Installing MongoDB Watchdog without
$settings['mongodb']threw aTypeError. It now reports a requirement error. - The request tracking message had a stray
</a>. At runtime, it now links to the MongoDB Watchdog settings form.
Related, not required by Drupal 12:
- #3425809: Implement new QueueFactoryInterface: implementing core's
QueueFactoryInterface. - #3626728: Remove deprecated collStats after MongoDB release 6.2: the
collStatscommand, deprecated since MongoDB 6.2. - #3627078: UI errors in post-D7 recent versions: admin UI problems found while testing on Drupal 12, also present on Drupal 11.
Remaining tasks
- Drush commands: they are still declared in
drush.services.yml, which Drush 13 marks as deprecated. Check whether Drush 14 still loads it once it has a stable release, and move the commands to attributes if not.
User interface changes
On the status report, MongoDB errors and warnings now show with their real severity, and the request tracking message links to the MongoDB Watchdog settings form.
API changes
core_version_requirementnow includes^12.0.Drupal\mongodb_watchdog\Install\Requirementsis renamedRequirementsChecker, with no alias. Its service ID,mongodb.watchdog_requirements, is unchanged.
Data model changes
None.
AI disclosure
Issue and MR are AI-assisted.
Issue fork mongodb-3626729
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
Comment #2
fgmComment #3
fgmComment #4
fgmComment #6
fgmComment #8
fgmMerged to today's HEAD.
Comment #10
fgmComment #11
matthandWow you're really on a hot streak! Way to go @fgm!