Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global D8 container is not available when rebuilding the container #3123

Closed
kevin-dutra opened this issue Oct 31, 2017 · 0 comments · Fixed by #3124
Closed

Global D8 container is not available when rebuilding the container #3123

kevin-dutra opened this issue Oct 31, 2017 · 0 comments · Fixed by #3124

Comments

@kevin-dutra
Copy link
Contributor

Typically when the container is being rebuilt, it's within the context of a normal Drupal page request. At that point, Drupal has already booted and the global container is available, leaving services available for use in certain other steps, like defining events that your EventSubscriber subscribes to. Unfortunately, Drush's DrupalKernel will immediately rebuild the container without having the global container initialized with the existing one.

The particular use case we've run into that is causing us headaches is the Rules module (though there may be others). It utilizes the State API to determine which events one of its EventSubscribers should subscribe to. If the global container is not yet available, then it can't get the state service to subscribe to the correct events and then the rules you expect to trigger never do anything.

kevin-dutra added a commit to kevin-dutra/drush that referenced this issue Oct 31, 2017
kevin-dutra added a commit to kevin-dutra/drush that referenced this issue Oct 31, 2017
kevin-dutra added a commit to kevin-dutra/drush that referenced this issue Oct 31, 2017
kevin-dutra added a commit to kevin-dutra/drush that referenced this issue Nov 2, 2017
kevin-dutra added a commit to kevin-dutra/drush that referenced this issue Nov 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant