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

CommentFileSizeAuthor
#5 3557586-service-5-MR44.patch1.03 KBjannakha
Command icon 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

cpigott created an issue. See original summary.

cpigott’s picture

Title: 4.0.0-alpha5 broken on Drupal 10.5 » Use of views.field_data_provider with Drupal 10

cpigott’s picture

MR 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?)

jannakha’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new1.03 KB

MR44 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?

jannakha’s picture

@jibran what's the rational for the change?
https://git.drupalcode.org/project/dynamic_entity_reference/-/blame/4.x/...
oversite for D10?

realityloop made their first commit to this issue’s fork.

anybody’s picture

Confirming RTBC. any chance to merge this soon? I can confirm in 3.x this doesn't happen in D10.

jibran’s picture

Thank you for reaching out. I'll have a look over the weekend.

anybody’s picture

@jibran any chance to merge and fix this critical issue??

anybody’s picture

PS: The fix still works perfectly fine! Just ran into this in another project.

larowlan’s picture

Status: Reviewed & tested by the community » Needs work

MR 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!

jannakha’s picture

Status: Needs work » Needs review

updated as per #12

larowlan’s picture

Status: Needs review » Needs work

Tests 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

jannakha’s picture

Issue summary: View changes
larowlan’s picture

jannakha’s picture

Status: Needs work » Needs review

fixed, 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/...

  • larowlan committed 702939c7 on 4.x authored by cpigott
    fix: #3557586 Use of views.field_data_provider with Drupal 10
    
    By:...
larowlan’s picture

Status: Needs review » Fixed

Committed current state, thanks

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

larowlan’s picture

larowlan’s picture

Version: 4.0.0-alpha5 » 3.x-dev
Status: Fixed » Patch (to be ported)

Same issue exists on 3.x

larowlan’s picture

Status: Patch (to be ported) » Fixed

The new 3.x version fixes this and works w/ D12

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.