Problem/Motivation
Version 3.9 introduced isDeprecatedConfigDirectorySettingUsed() for the UpgradeStatusForm, which includes settings.php.
However, if you use the $class_loader variable in settings.php it will cause a fatal error as $class_loader is not defined in this context.
Steps to reproduce
Any config in settings.php that uses $class_loader will do.
Proposed resolution
See patch attached.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3229107-2.patch | 410 bytes | andreasderijcke |
Comments
Comment #2
andreasderijckeComment #3
andreasderijckeAdded patch.
Comment #4
gábor hojtsyHm, core's Drupal\Core\Site\Settings class does not provide the class loader to settings.php either when it includes it for settings handling. Why would we need to?
Comment #5
andreasderijckeIt does, see https://git.drupalcode.org/project/drupal/-/blob/8.9.x/core/lib/Drupal/C...
Also, default.settings.php contains an example using $class_loader: https://git.drupalcode.org/project/drupal/-/blob/8.9.x/sites/default/def...
I don't know the specific reason, as it is not mentioned in the Redis module docs, but some redis setups use it to register the redis namespace.
For example https://community.platform.sh/t/how-to-use-redis-for-caching-a-drupal-8-....
Comment #6
gábor hojtsyAh and its done intentionally.
Comment #8
gábor hojtsySo the question is if this is the best way to get the class loader that is in the state normally passed into settings.php.
index.php has
which is then saved as
classLoaderin the kernel which is passed into the settings initializer.Looks good, let's get in!