ViewfieldServiceProvider Manually created services must specify public or private

Created on 28 March 2023, almost 2 years ago

Problem/Motivation

Per https://www.drupal.org/node/3194517 ,

For Drupal 9 a deprecation will be issued if a service is manually created without specifying either private or public, this will be required from Drupal 10.0.0 onwards.

Services are created private as default in Symfony 5 and Drupal expects services to be public. Drupal 9 uses Symfony 4.4 and Drupal 10 will use Symfony > 5.4.

All services created from SOMEMODULE.services.yml are changed to public by default. Only services created like:

Drupal\viewfield\ViewfieldServiceProvider creates a service definition and needs to set service public.

Steps to reproduce

Proposed resolution

Add $service_definition->setPublic(TRUE);

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Needs review

Version

3.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024