Problem/Motivation
If you try to install the name module during Drupal site install, for example using a profile and requiring the name module there (or another module, that requires the name module), you will receive the following error:
You have requested a synthetic service ("kernel"). The DIC does not know how to construct this service.
This is probably happening since version 8.x-1.3, respectively since #3586117: Implement OOP Hooks
Steps to reproduce
Create a very basic profile, like
name_profile.info.yml
name: Name Profile
type: profile
description: 'Name installation profile.'
core_version_requirement: ^11
distribution:
name: Name Profile
install:
- name
Install Drupal using this profile like:
drush site:install name_profile -y
Compare between version 8.x-1.4 (failing with error) and 8.x-1.2 (not failing).
Proposed resolution
I suppose the Hook implementations should be refactored on use of dependency injection for services that itself require very deep dependencies, like config.factory. Maybe it is better using things like \Drupal::config or Drupal::service() for these cases.
And also some of the alias definitions in the services.yml seem to be problematic with regards to this error.
But honestly I am still a bit unsure, about the best way solving this.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork name-3591120
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
stefan.kornComment #3
stefan.kornComment #4
bluegeek9 commentedHi Stefan,
I will test this and get a patch created.
I think one or more of the services need the `lazy: true` set.
I think this might be the name.user_realname_preload service.
Comment #5
bluegeek9 commentedComment #8
bluegeek9 commentedComment #11
bluegeek9 commentedWe should add a test profile, and an automate test so this does not happen in the future.
Comment #14
bluegeek9 commented