Explain to developers in plain language when they've misnamed module files

Created on 17 March 2017, about 7 years ago
Updated 15 June 2023, about 1 year ago

My module files were incorrectly named, these files were named wrong:

  • my_module.info.yml
  • my_module.module
  • my_module.routing.yml

This error message is therefore poor!

The website encountered an unexpected error. Please try again later.

InvalidArgumentException: Class "\Drupal\my_module\Controller\VisaApplicationController" does not exist. in Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (line 24 of core/lib/Drupal/Core/DependencyInjection/ClassResolver.php).
Drupal\Core\Controller\ControllerResolver->createController('\Drupal\my_module\Controller\VisaApplicationController::content') (Line: 74)
Drupal\Core\Controller\ControllerResolver->getControllerFromDefinition('\Drupal\my_module\Controller\VisaApplicationController::content', '/my_module/') (Line: 91)
Drupal\Core\Controller\ControllerResolver->getController(Object) (Line: 132)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 652)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Bad error messages waste thousands of coding hours for everyone! We need to get this right.

The error message should be:

Missing module files:

  • my_module.info.yml
  • my_module.module
  • my_module.routing.yml
✨ Feature request
Status

Closed: outdated

Version

11.0 πŸ”₯

Component
ExtensionΒ  β†’

Last updated 3 days ago

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024