Problem/Motivation
#2975328-39: Install profile in settings.php and mismatch check makes re-installs of Drupal hard introduced a grammar as pointed out by @xjm.
+++ b/core/includes/install.core.inc @@ -2214,16 +2213,16 @@ function install_display_requirements($install_state, $requirements) { - // Only need to write to settings.php if it is possible. The primary storage - // for the install profile is the core.extension configuration. + // Only write the install profile to settings.php if already exists. The value + // from settings.php is never used but drupal_rewrite_settings() does not + // support removing a setting. If the value in configuration and settings.php + // don't match there will be a warning on the status report.
I realize this was already committed, but this comment is not clear and has a grammatical error ("if already exists"). As someone reading this code, I would want to know why the value from settings.php was never used (because it's deprecated I guess) and when the unspecified missing subject of the clause would already exist.
Proposed resolution
Fix the grammar. The reason why is contained in the deprecation message the function already has so probably not necessary to add.
* @deprecated in Drupal 8.3.0 and will be removed before Drupal 9.0.0. The
* install profile is written to core.extension.
*/
function install_write_profile($install_state) {
However, also when reading this comment it has not been updated with the current fix. Ie. we don't warn when there is a mismatch - we add a notice if the value is present in settings.php and inform the user they may remove it.
Remaining tasks
User interface changes
None
API changes
None
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#4 | 2982634-4.patch | 1.18 KB | alexpott |
#4 | 3-4-interdiff.txt | 832 bytes | alexpott |
#3 | 2982634-3.patch | 1.17 KB | alexpott |
Comments
Comment #2
alexpottComment #3
alexpottHere's a fix.
Comment #4
alexpottMissed out yet another word.
Comment #5
alexpottComment #6
kaythay CreditAttribution: kaythay at Aten Design Group commentedApplies and reads well. RTBC.
Comment #7
alexpottComment #8
Gábor HojtsyAdjusting credits.
Comment #9
Gábor HojtsyCommitted 4b1a8df and pushed to 8.6.x. Thanks!