From de6da93901a4c1d6526328a50bb74d497ba275b5 Mon Sep 17 00:00:00 2001
From: catch <catch@35733.no-reply.drupal.org>
Date: Thu, 14 Feb 2013 11:32:40 +0000
Subject: [PATCH] Issue #1914040 by vijaycs85: Fixed Private file system path
 is '0' after installation.

---
 core/modules/system/config/system.file.yml    |  2 +-
 .../Drupal/system/Tests/File/ConfigTest.php   | 57 +++++++++++++++++++
 core/modules/system/system.admin.inc          |  2 +-
 3 files changed, 59 insertions(+), 2 deletions(-)
 create mode 100644 core/modules/system/lib/Drupal/system/Tests/File/ConfigTest.php

diff --git a/core/modules/system/config/system.file.yml b/core/modules/system/config/system.file.yml
index 16fe7bfc276a..b5be48c9447b 100644
--- a/core/modules/system/config/system.file.yml
+++ b/core/modules/system/config/system.file.yml
@@ -5,5 +5,5 @@ chmod:
   file: '0664'
 default_scheme: 'public'
 path:
-  private: '0'
+  private: ''
   temporary: ''
diff --git a/core/modules/system/lib/Drupal/system/Tests/File/ConfigTest.php b/core/modules/system/lib/Drupal/system/Tests/File/ConfigTest.php
new file mode 100644
index 000000000000..73143659d625
--- /dev/null
+++ b/core/modules/system/lib/Drupal/system/Tests/File/ConfigTest.php
@@ -0,0 +1,57 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\system\Tests\File\ConfigTest.
+ */
+
+namespace Drupal\system\Tests\File;
+
+/**
+ * File system configuration related tests.
+ */
+class ConfigTest extends FileTestBase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'File system configuration test',
+      'description' => 'Tests file system configuration operations',
+      'group' => 'File API',
+    );
+  }
+
+  function setUp(){
+    parent::setUp();
+    $this->web_user = $this->drupalCreateUser(array('administer site configuration'));
+    $this->drupalLogin($this->web_user);
+  }
+
+  /**
+   * Tests file configuration page.
+   */
+  function testFileConfigurationPage() {
+    $this->drupalGet('admin/config/media/file-system');
+
+    // Set the file paths to non-default values.
+    // The respective directories are created automatically
+    // upon form submission.
+    $file_path = $this->public_files_directory;
+    $fields = array(
+      'file_public_path' => $file_path . '/file_config_page_test/public',
+      'file_private_path' => $file_path . '/file_config_page_test/private',
+      'file_temporary_path' => $file_path . '/file_config_page_test/temporary',
+      'file_default_scheme' => 'private',
+    );
+
+    // Check that all fields are present.
+    foreach ($fields as $field => $path) {
+      $this->assertFieldByName($field);
+    }
+
+    $this->drupalPost(NULL, $fields, t('Save configuration'));
+    $this->assertText(t('The configuration options have been saved.'));
+    foreach ($fields as $field => $value) {
+      $this->assertFieldByName($field, $value);
+    }
+  }
+}
diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc
index 6583d5743d3b..b483e7e2adaa 100644
--- a/core/modules/system/system.admin.inc
+++ b/core/modules/system/system.admin.inc
@@ -1749,7 +1749,7 @@ function system_clear_page_cache_submit($form, &$form_state) {
  * @ingroup forms
  * @see system_settings_form_sumbit()
  */
-function system_file_system_settings() {
+function system_file_system_settings($form, $form_state) {
   $config = config('system.file');
   $form['file_public_path'] = array(
     '#type' => 'textfield',
-- 
GitLab