Updated: Comment 0

Problem/Motivation

If you try to write a ServiceModifier without being a ServiceProvider you end up in:

PHP Fatal error:  Call to undefined method Drupal\twig_routing\TwigRoutingServiceProvider::register() in /var/www/d8/core/lib/Drupal/Core/DrupalKernel.php on line 518
PHP Stack trace:
PHP   1. {main}() /home/dawehner/config/bin/drush/drush.php:0
PHP   2. drush_main() /home/dawehner/config/bin/drush/drush.php:16
PHP   3. _drush_bootstrap_and_dispatch() /home/dawehner/config/bin/drush/drush.php:61
PHP   4. drush_dispatch() /home/dawehner/config/bin/drush/drush.php:92
PHP   5. call_user_func_array() /home/dawehner/config/bin/drush/includes/command.inc:182
PHP   6. drush_command() /home/dawehner/config/bin/drush/includes/command.inc:182
PHP   7. _drush_invoke_hooks() /home/dawehner/config/bin/drush/includes/command.inc:214
PHP   8. call_user_func_array() /home/dawehner/config/bin/drush/includes/command.inc:362
PHP   9. drush_pm_enable() /home/dawehner/config/bin/drush/includes/command.inc:362
PHP  10. drush_module_enable() /home/dawehner/config/bin/drush/commands/pm/pm.drush.inc:1013
PHP  11. module_install() /home/dawehner/config/bin/drush/commands/core/drupal/environment.inc:148
PHP  12. Drupal\Core\Extension\ModuleHandler->install() /var/www/d8/core/includes/module.inc:211
PHP  13. Drupal\Core\DrupalKernel->updateModules() /var/www/d8/core/lib/Drupal/Core/Extension/ModuleHandler.php:613
PHP  14. Drupal\Core\DrupalKernel->boot() /var/www/d8/core/lib/Drupal/Core/DrupalKernel.php:331
PHP  15. Drupal\Core\DrupalKernel->initializeContainer() /var/www/d8/core/lib/Drupal/Core/DrupalKernel.php:176
PHP  16. Drupal\Core\DrupalKernel->buildContainer() /var/www/d8/core/lib/Drupal/Core/DrupalKernel.php:427

Proposed resolution

Remaining tasks

User interface changes

API changes

CommentFileSizeAuthor
#1 kernel-2118763-1.patch1014 bytesdawehner
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Status: Active » Needs review
FileSize
1014 bytes

.

Berdir’s picture

dawehner’s picture

Status: Needs review » Closed (duplicate)

Let's mark this issue as duplicate.