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

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

stefan.korn created an issue. See original summary.

stefan.korn’s picture

Project: Address » Name Field
stefan.korn’s picture

Issue summary: View changes
Related issues: +#3586117: Implement OOP Hooks
bluegeek9’s picture

Hi 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.

bluegeek9’s picture

Assigned: Unassigned » bluegeek9

  • bluegeek9 committed c38ef0fa on 8.x-1.x
    fix: #3591120 Error installing name module during site install
    
bluegeek9’s picture

Assigned: bluegeek9 » Unassigned
Status: Active » Fixed
//www.flaticon.com/free-icons/thank-you Thank you for your contribution! Your continued support makes this project sustainable.
There are multiple ways to show appreciation for the work contributed to this project including:

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.

bluegeek9 changed the visibility of the branch 8.x-1.x to hidden.

bluegeek9’s picture

Status: Fixed » Active

We should add a test profile, and an automate test so this does not happen in the future.

  • bluegeek9 committed cb70bb6a on 8.x-1.x
    fix: #3591120 Error installing name module during site install
    
bluegeek9’s picture

Status: Active » 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.

Status: Fixed » Closed (fixed)

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