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),
Issue fork svg_image_field-3560629
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
jstollerComment #4
jurgenhaasWe ran into the same issue with a number of sites showing WSOD. The MR fixes that issue, thank you.
Comment #5
jwilson3Thanks. 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.
Comment #7
jwilson3Comment #9
jwilson3I've created a follow-up: #3560658: Test coverage: SVG Image Field <> Views
Comment #10
jwilson3This fix has been released in 2.3.6.