Problem/Motivation
#3106531: Notify in Status Report that per-table database prefixes are no longer supported, and will throw errors in Drupal 10.0 introduces a function that includes settings.php again as part of requirements checks.
But that IMHO has two problems:
a) It is missing context, for example $class_loader. To use an alternative cache backend for the container cache, you afaik need to set the class loader explicitly, afaik that is still required. This is a fatal error now.
b) It loads those files a second time. They could do all kinds of things like messing with request data, define functions and what not that would cause problems.
Not quite sure what we can do? At least for the current/default connection, we can access \Drupal::database()->getConnectionOptions()['extra_prefix']
, we could reduce the function to just checking that as a quickfix?
Other approaches would be to parse/preg match the settings file, but there can be includes to other files that define the database info. Does not seem viable
Remaining tasks
None
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
TBD
Comment | File | Size | Author |
---|---|---|---|
#4 | 3251625-4.patch | 1.83 KB | alexpott |
Comments
Comment #2
BerdirComment #3
catchLet's try that. It's only the status report and the likelihood of a site actually using this is quite low these days, so better to do the absolute minimum.
Comment #4
alexpottThe test added by #3106531: Notify in Status Report that per-table database prefixes are no longer supported, and will throw errors in Drupal 10.0 is working so the approach looks good.
Comment #5
mondrakeLooks good to me. It's weird there's no other way to get to the raw settings - with this change we are already checking the processed ones.
Comment #8
catchCommitted/pushed to 9.4.x and cherry-picked to 9.3.x, thanks!