From 8e7a80bb0f0d1080ed3534815b51e5ba72baea43 Mon Sep 17 00:00:00 2001
From: Nathaniel <catch@35733.no-reply.drupal.org>
Date: Tue, 14 Feb 2012 12:39:35 +0900
Subject: [PATCH] Issue #334948 by David_Rothstein, Albert Volkman: Fixed The
 'default' folder is sometimes required to be writable even when installing
 Drupal in sites/example.com.

---
 core/modules/system/system.install | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index 7a275e81d6b5..d8112e63183a 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -292,8 +292,13 @@ function system_requirements($phase) {
   }
 
   // Test files directories.
+  // If we are installing Drupal, the settings.php file might not exist yet in
+  // the intended conf_path() directory, so don't require it. The conf_path()
+  // cache must also be reset in this case.
+  $require_settings = ($phase != 'install');
+  $reset_cache = !$require_settings;
   $directories = array(
-    variable_get('file_public_path', conf_path() . '/files'),
+    variable_get('file_public_path', conf_path($require_settings, $reset_cache) . '/files'),
     // By default no private files directory is configured. For private files
     // to be secure the admin needs to provide a path outside the webroot.
     variable_get('file_private_path', FALSE),
-- 
GitLab