Score:0

Do I need to apply changes in default.settings.php to settings.php?

ec flag

Recent updates to Drupal 7 have included changes in default.settings.php.

Do they need to be incorporated into settings.php manually, or does the code automatically look up in default.settings.php when it can't find something in settings.php? Apologies if this is in the documentation, I couldn't find it.

taggartJ avatar
cn flag
I am just going to say no ( I have not for over 10 years) and manny manny manny sites are just fine lol
leymannx avatar
ne flag
Have your site in an isolated env and try it out yourself.
wil_SRQ avatar
ec flag
Well, it's good to know I'm not alone! Still. would be good to know what the code's expectations are.
Kevin avatar
in flag
I guess it depends on what the changes are. Code comment updates, or security changes.. you'd want to incorporate the latter for sure.
Kevin avatar
in flag
Yes that's what I mean, but you could have setups too that generate new sites from a default settings file through a UI. Then the new site has the updates in its new settings.php file.
Score:1
us flag

Speaking specifically about the last change done for the default.settings.php file: No, you do not need to apply that change to the setting.php file, except in the case you need to change the default value used for the lock expiration timeout, which is 900 and which usually sufficient for any site.

The following is the patch for the change described in [D7] Cron lock time limit is too short and does not prevent multiple, concurrent cron runs.

diff --git a/includes/common.inc b/includes/common.inc
index 0f6ced800d..094db87f54 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -5532,7 +5532,8 @@ function drupal_cron_run() {
   drupal_alter('cron_queue_info', $queues);
 
   // Try to acquire cron lock.
-  if (!lock_acquire('cron', 240.0)) {
+  $cron_lock_expiration_timeout = variable_get('cron_lock_expiration_timeout', 900.0);
+  if (!lock_acquire('cron', $cron_lock_expiration_timeout)) {
     // Cron is still running normally.
     watchdog('cron', 'Attempting to re-run cron while it is already running.', array(), WATCHDOG_WARNING);
   }
diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php
index c521bc3b3a..4458ee47d0 100644
--- a/sites/default/default.settings.php
+++ b/sites/default/default.settings.php
@@ -821,3 +821,15 @@
  */
 # $conf['drupal_http_request_strip_sensitive_headers_on_host_change'] = TRUE;
 # $conf['drupal_http_request_strip_sensitive_headers_on_https_downgrade'] = TRUE;
+
+/**
+ * Cron lock expiration timeout:
+ *
+ * Each time Drupal's cron is executed, it acquires a cron lock. Older releases
+ * of Drupal set the default cron lock expiration timeout to 240 seconds. This
+ * duration was considered short, because it often caused concurrent cron runs
+ * especially on busy sites heavily utilizing cron.
+ *
+ * Use this variable to set a custom cron lock expiration timeout (float).
+ */
+# $conf['cron_lock_expiration_timeout'] = 900.0;

The last comment explains exactly what the purpose of that value is and why it was introduced.

Each time Drupal's cron is executed, it acquires a cron lock. Older releases of Drupal set the default cron lock expiration timeout to 240 seconds. This duration was considered short, because it often caused concurrent cron runs especially on busy sites heavily utilizing cron.

If you do not notice any Attempting to re-run cron while it is already running. error in the Drupal log, then you do not need to add that line ($conf['cron_lock_expiration_timeout'] = 900.0;) to the settings.php file used for the site. Otherwise, you need to add it.

does the code automatically look up in default.settings.php when it can't find something in settings.php?

No, it does not. Drupal only load the settings.php file, when running. Any change done to the default.settings.php file that is relevant for you need to be copied into the settings.php file used for the site. Keep in mind that, in some cases, the copied lines could need to be adapted for your use case.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.