Closed (fixed)
Project:
Scheduler
Version:
2.x-dev
Component:
Testing
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
30 Apr 2026 at 15:02 UTC
Updated:
25 Jun 2026 at 08:25 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #4
jonathan1055 commentedStarting point using Next Minor on Gitlab Templates default-ref. The phpunit 'scheduler' test group log is 15,401 lines long. There are 125 matches for
#[LegacyRequirementsHook] attribute is deprecatedbut only 25 of those are for Scheduer. There are 20 tests and each test reports 5 deprecations. The other 4 are for address, commerce x2 and token.Comment #5
jonathan1055 commentedUsing Gitlab Templates 'main' ref the Next Minor phpunit log is 15,364 lines. The saving of only 37 lines is the removal of the TestDiscovery deprecation warnings for 3rd-party modules. The phpunit deprecations for other modules are still shown in the log.
Comment #6
jonathan1055 commentedThere are three types of change linked from the main change record, and https://www.drupal.org/node/3490851 deals with
$phase === 'runtime'which is what we have in scheduler_requirements() in scheduler.install. The example is inside a new classFileRequirementsHookin theDrupal\{myproject}\Hooknamespace. It is not clear how to do this when the original implementation is in a global function in procedural php in the .install file.The first linked CR https://www.drupal.org/node/3492429 explains about adding the new class
Drupal\{mymodule}\Install\Requirementsbut this is not the same as the runtime phase.Comment #7
jonathan1055 commentedAfter adding #[LegacyRequirementsHook] in .install (using this core example) the message count has dropped from 125 to 100
https://git.drupalcode.org/project/scheduler/-/jobs/10210896/viewer
Good to see that we get a test failure
as that shows the status message is not be present when the legacy hook is not run on 11.3+
Comment #8
jonathan1055 commentedAfter a little trial and error, due to not being able to find any example or help from the CR, I found that
src/Hook/SchedulerRequirementsHook.phpis the correct file to add. (commit)Screen grabs showing the original function in use on 11.2 and the new on 11.3
The message test is fixed. Next to remove the 100 deprecation messages for 3rd-party modules.
Comment #10
jonathan1055 commentedWith this commit to .deprecation-ignore.txt we no longer get the other 100
#[LegacyRequirementsHook] attribute is deprecatedmessages for the 3rd-party modules. The log is only 11,819 lines