InvalidArgumentException: "Class "\Drupal\environment_indicator\Form\EnvironmentIndicatorSettingsForm" does not exist."

Created on 6 April 2023, over 1 year ago

Problem/Motivation

Uncaught PHP Exception InvalidArgumentException: "Class "\Drupal\environment_indicator\Form\EnvironmentIndicatorSettingsForm" does not exist." at ...\web\core\lib\Drupal\Core\DependencyInjection\ClassResolver.php line 24

Watchdog message: InvalidArgumentException: Class "\Drupal\environment_indicator\Form\EnvironmentIndicatorSettingsForm" does not exist. in Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (line 24 of ...\web\core\lib\Drupal\Core\DependencyInjection\ClassResolver.php).

  • Drupal 10.0.7
  • PHP 8.1.13
  • MySQL 8.0.32
  • Apache 2.4.46

Steps to reproduce

Install the module, enable, and then attempt to access the configuration page (without altering settings.php or setting.local.php). White screen of death, and the above message in the log.

Proposed resolution

Instead of having a catastrophic failure when attempting to access the configuration page in the above scenario, simply show a page that instructs the viewer to make those changes first in order to use the configuration.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

🇨🇦Canada sdsheridan Toronto

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

Comments & Activities

  • Issue created by @sdsheridan
  • 🇨🇦Canada sdsheridan Toronto

    OK, just realised that the documentation needs to be updated for this to not happen. The settings.php (or settings.local.php) adjustments must be made first, and for D10, the variable is $settings, not $config. That said, it probably shouldn't catastrophically fail if those changes are not yet made, but rather should show instructions to that effect on the configuration page.

    Also, not seeing any changes now despite being able to access the configuration page. Will open separate issue for that.

Production build 0.71.5 2024