Problem/Motivation

After updating SVG Image Field to version 2.3.5, my website crashes on page load with the error:

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "views.views_field_default_data". in Drupal\Component\DependencyInjection\Container->get() (line 157 of core/lib/Drupal/Component/DependencyInjection/Container.php).

The bug was introduced in #3501879: Drupal 11.2.x compatibility

Proposed resolution

I've traced the error to line 28 of svg_image_field.views.inc, which currently reads:

currentCallable: fn() => \Drupal::service('views.views_field_default_data')->defaultFieldImplementation($field_storage),

But should be:

currentCallable: fn() => \Drupal::service('views.field_data_provider')->defaultFieldImplementation($field_storage),
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

jstoller created an issue. See original summary.

jstoller’s picture

Version: 2.3.5 » 2.3.x-dev
Status: Active » Needs review
jurgenhaas’s picture

Status: Needs review » Reviewed & tested by the community

We ran into the same issue with a number of sites showing WSOD. The MR fixes that issue, thank you.

jwilson3’s picture

Thanks. I've confirmed that, in fact, according to the CR related to this: https://www.drupal.org/node/3489502, the service name was incorrectly coded in #3501879: Drupal 11.2.x compatibility.

I'm not entirely certain how this was missed in Gitlab CI tests, but my guess is that the module doesn't test the Views integration pathway thoroughly enough, or even at all.

It would be amazing to have a "tests only" MR that surfaces this error, while we're at it here, but I'm going to prioritize getting a fix out first, as folks begin updating SVG Image Field more widely this coming week, so they don't hit the same issue.

jwilson3’s picture

Status: Reviewed & tested by the community » Fixed

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.

jwilson3’s picture

jwilson3’s picture

This fix has been released in 2.3.6.

Status: Fixed » Closed (fixed)

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