Problem/Motivation
I'm working at getting Scheduled Transitions going with CI's next major, which is D12/main-branch.
The one remaining test failure im seeing, and what I'm now also seeing in the DER CI pipelines, is the error:
Time: 01:08.314, Memory: 14.00 MB
There was 1 error:
1) Drupal\Tests\scheduled_transitions\Functional\ScheduledTransitionViewsListTest::testList
InvalidArgumentException: Class "dynamic_entity_reference_views_data" does not exist.
/builds/project/scheduled_transitions/web/core/lib/Drupal/Core/DependencyInjection/ClassResolver.php:32
/builds/project/scheduled_transitions/web/core/lib/Drupal/Core/Utility/CallableResolver.php:78
/builds/project/scheduled_transitions/web/core/lib/Drupal/Core/Extension/ModuleHandler.php:637
/builds/project/scheduled_transitions/web/core/lib/Drupal/Core/Extension/ModuleHandler.php:285
/builds/project/scheduled_transitions/web/core/modules/views/src/ViewsData.php:244
/builds/project/scheduled_transitions/web/core/modules/views/src/ViewsData.php:164
/builds/project/scheduled_transitions/web/core/modules/views/src/Entity/View.php:455
/builds/project/scheduled_transitions/web/core/lib/Drupal/Core/Config/ConfigInstaller.php:428
/builds/project/scheduled_transitions/web/core/lib/Drupal/Core/Config/ConfigInstaller.php:299
/builds/project/scheduled_transitions/web/core/lib/Drupal/Core/Config/ConfigInstaller.php:192
/builds/project/scheduled_transitions/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php:451
/builds/project/scheduled_transitions/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php:219
/builds/project/scheduled_transitions/web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:511
/builds/project/scheduled_transitions/web/core/tests/Drupal/Tests/BrowserTestBase.php:560
/builds/project/scheduled_transitions/web/core/tests/Drupal/Tests/BrowserTestBase.php:350
It seems to me this is because \Drupal\Core\Utility\CallableResolver::getCallableFromDefinition is_callable is failing. My guess is that DER's dynamic_entity_reference.views.inc isnt being included automatically.
I wasnt able to trace an exact issue where .inc files may not be included anymore yet, but I can see various changes to core which are removing inc files...
Proposed resolution
So I took a stab at seeing if changing the .inc file to `#[Hook]`'s would solve it, and it seems it does. So, I'm proposing we move to convert this file.
The MR herein simply:
- copies and pastes the functions into methods into a new class
- changes \Drupal:: calls to use DI
- adds gates in case views is not enabled, which will satisfy phpstan
- \t() -> $this->t()
- is based on DER HEAD
Remaining tasks
- Evaluate if this is the right solution at the right time.
- Bring up the minimum Drupal version.
- If DER maintainers dont want to change the minimum supported Drupal versions to ones which universally support `#[Hook]`, id suggest some kind of hook bridge between the existing file, which has a version gate/sniff in it (perhaps via class_exists(Hook::class)`.
User interface changes
None
API changes
Some, but considered private API surface.
Data model changes
None.
| Comment | File | Size | Author |
|---|
Issue fork dynamic_entity_reference-3578427
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 #3
dpiComment #4
dpiHeres a patch for v3.2.1, since patches generated from the MR based on 3.x HEAD will not apply due to intermediate changes.
Comment #5
dpiDER recent failure in daily: March 10, 2026 at 6:00:56 AM GMT+8
6 errors containing:
https://git.drupalcode.org/project/dynamic_entity_reference/-/pipelines/...
test: phpunit (next major): job: https://git.drupalcode.org/project/dynamic_entity_reference/-/jobs/8837997
Comment #6
dpiThe ST issue https://git.drupalcode.org/project/scheduled_transitions/-/merge_request...
Comment #7
dpiIf you're looking at this anytime soon, know that the current builds may be broken due to #3570077-39: Update to Symfony 8
Comment #8
dpi