Problem/Motivation
4.0.0-alpha5 is broken on Drupal 10.5, with errors taking down the whole site:
Uncaught PHP Exception Symfony\\Component\\DependencyInjection\\Exception\\ServiceNotFoundException: "You have requested a non-existent service "views.field_data_provider"." at /var/www/drupal/web/core/lib/Drupal/Component/DependencyInjection/Container.php line 159
This seems to be due to usage of "views.field_data_provider" which is only available in D11. This was introduced in https://www.drupal.org/project/dynamic_entity_reference/issues/2283919 / https://git.drupalcode.org/project/dynamic_entity_reference/-/commit/0f3...
Notes:
- views_field_default_views_data have been deprecated in 11.2: https://www.drupal.org/node/3489502
- use DeprecationHelper: https://www.drupal.org/node/3379306
Steps to reproduce
Install 4.0.0-alpha5 on Drupal 10.5
Proposed resolution
Reversing the mentioned change seems to work.
Geolocation solved the same problem here: https://www.drupal.org/project/geolocation/issues/3536753
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3557586-service-5-MR44.patch | 1.03 KB | jannakha |
Issue fork dynamic_entity_reference-3557586
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
cpigott commentedComment #4
cpigott commentedMR fixes this particular inconsistency. Of course, if dropping D10 support was intentional, then the composer.json / *.info.yml should be updated instead... (Google also found https://contrib.social/issue/3540397 which suggests it may be partially intentional?)
Comment #5
jannakha commentedMR44 patch attached, fixes the issue.
Drupal 10 should be supported as it states "Works with Drupal: ^10 || ^11"
what's contrib.social? it's not loading, this service looks outdated, supported by one person, no privacy policy, no supporting organisation, this service wants to get access to my github account?
Comment #6
jannakha commented@jibran what's the rational for the change?
https://git.drupalcode.org/project/dynamic_entity_reference/-/blame/4.x/...
oversite for D10?
Comment #8
anybodyConfirming RTBC. any chance to merge this soon? I can confirm in 3.x this doesn't happen in D10.
Comment #9
jibranThank you for reaching out. I'll have a look over the weekend.
Comment #10
anybody@jibran any chance to merge and fix this critical issue??
Comment #11
anybodyPS: The fix still works perfectly fine! Just ran into this in another project.
Comment #12
larowlanMR looks good to me, but causes phpcs to fail when it is passing in HEAD - can we make use of the DeprecationHelper class instead of using method exists? That should resolve the phpcs issue
Thanks!
Comment #13
jannakha commentedupdated as per #12
Comment #14
larowlanTests are failing, I looked into it further, the method we're calling doesn't exist - left a comment with what seems to be the recommended replacement
Comment #15
jannakha commentedComment #16
larowlanAdded #3570942: Failing update path tests in HEAD
Comment #17
jannakha commentedfixed, but since DeprecationHelper was introduced in 10.2 - min version should be updated? (there's already another usage of DeprecationHelper in this codebase ./src/Plugin/Field/FieldType/DynamicEntityReferenceItem.php) but info.yml has core_version_requirement: ^10 || ^11
Tests are failing maybe for a different reason - here's branch 4.0.x in development with same failing tests:
https://git.drupalcode.org/project/dynamic_entity_reference/-/pipelines/...
Comment #19
larowlanCommitted current state, thanks
Comment #21
larowlanhttps://www.drupal.org/project/dynamic_entity_reference/releases/4.0.0-a...
Comment #22
larowlanSame issue exists on 3.x
Comment #23
larowlanThe new 3.x version fixes this and works w/ D12