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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Issue summary: View changes
alexpott’s picture

Status: Active » Needs review
FileSize
1.17 KB

Here's a fix.

alexpott’s picture

Missed out yet another word.

alexpott’s picture

Issue summary: View changes
kaythay’s picture

Status: Needs review » Reviewed & tested by the community

Applies and reads well. RTBC.

alexpott’s picture

Title: Fix grammar in install_write_profile() » Fix docs in install_write_profile()
Gábor Hojtsy’s picture

Adjusting credits.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Committed 4b1a8df and pushed to 8.6.x. Thanks!

  • Gábor Hojtsy committed 4b1a8df on 8.6.x
    Issue #2982634 by alexpott, kaythay: Fix docs in install_write_profile()
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.