From 8296db7ae43503eacd2448aacdae65baf3a5f11b Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Wed, 8 May 2013 10:24:08 +0100
Subject: [PATCH] Issue #1696224 by aroq: Remove system_settings_form().

---
 .../Drupal/system/SystemConfigFormBase.php    |  4 +-
 core/modules/system/system.admin.inc          |  4 +-
 core/modules/system/system.api.php            |  2 +-
 core/modules/system/system.module             | 55 ++-----------------
 4 files changed, 9 insertions(+), 56 deletions(-)

diff --git a/core/modules/system/lib/Drupal/system/SystemConfigFormBase.php b/core/modules/system/lib/Drupal/system/SystemConfigFormBase.php
index 25b8d28e3e08..81b80f1b889e 100644
--- a/core/modules/system/lib/Drupal/system/SystemConfigFormBase.php
+++ b/core/modules/system/lib/Drupal/system/SystemConfigFormBase.php
@@ -59,8 +59,8 @@ public function buildForm(array $form, array &$form_state) {
       '#button_type' => 'primary',
     );
 
-    // By default, render the form using theme_system_settings_form().
-    $form['#theme'] = 'system_settings_form';
+    // By default, render the form using theme_system_config_form().
+    $form['#theme'] = 'system_config_form';
 
     return $form;
   }
diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc
index 994eebf6ef8c..c6002f95f778 100644
--- a/core/modules/system/system.admin.inc
+++ b/core/modules/system/system.admin.inc
@@ -1418,7 +1418,7 @@ function system_modules_uninstall_submit($form, &$form_state) {
  * Form builder; The general site information form.
  *
  * @ingroup forms
- * @see system_settings_form()
+ * @see system_config_form()
  */
 function system_site_information_settings($form, &$form_state) {
   config_context_enter('config.context.free');
@@ -1773,7 +1773,7 @@ function system_clear_page_cache_submit($form, &$form_state) {
  * Form builder; Configure the site file handling.
  *
  * @ingroup forms
- * @see system_settings_form_sumbit()
+ * @see system_file_system_settings_submit()
  */
 function system_file_system_settings($form, $form_state) {
   $config = config('system.file');
diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php
index 84d1f564f91f..a59d8ebb3451 100644
--- a/core/modules/system/system.api.php
+++ b/core/modules/system/system.api.php
@@ -2774,7 +2774,7 @@ function hook_update_last_removed() {
  * Remove any information that the module sets.
  *
  * The information that the module should remove includes:
- * - variables that the module has set using variable_set() or system_settings_form()
+ * - variables that the module has set using variable_set()
  * - modifications to existing tables
  *
  * The module should not remove its entry from the module configuration.
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index a0e31c968e43..0c2e39d5a9cb 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -142,7 +142,7 @@ function system_theme() {
       'variables' => array('theme_groups' => NULL),
       'file' => 'system.admin.inc',
     ),
-    'system_settings_form' => array(
+    'system_config_form' => array(
       'render element' => 'form',
     ),
     'confirm_form' => array(
@@ -3290,53 +3290,6 @@ function system_default_region($theme) {
   return isset($regions[0]) ? $regions[0] : '';
 }
 
-/**
- * Add default buttons to a form and set its prefix.
- *
- * @param $form
- *   An associative array containing the structure of the form.
- *
- * @return
- *   The form structure.
- *
- * @see system_settings_form_submit()
- * @ingroup forms
- */
-function system_settings_form($form) {
-  $form['actions']['#type'] = 'actions';
-  $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save configuration'));
-
-  if (!empty($_POST) && form_get_errors()) {
-    drupal_set_message(t('The settings have not been saved because of the errors.'), 'error');
-  }
-  $form['#submit'][] = 'system_settings_form_submit';
-  // By default, render the form using theme_system_settings_form().
-  if (!isset($form['#theme'])) {
-    $form['#theme'] = 'system_settings_form';
-  }
-  return $form;
-}
-
-/**
- * Execute the system_settings_form.
- *
- * If you want node type configure style handling of your checkboxes,
- * add an array_filter value to your form.
- */
-function system_settings_form_submit($form, &$form_state) {
-  // Exclude unnecessary elements.
-  form_state_values_clean($form_state);
-
-  foreach ($form_state['values'] as $key => $value) {
-    if (is_array($value) && isset($form_state['values']['array_filter'])) {
-      $value = array_keys(array_filter($value));
-    }
-    variable_set($key, $value);
-  }
-
-  drupal_set_message(t('The configuration options have been saved.'));
-}
-
 /**
  * Adds default behavior to a configuration form.
  *
@@ -3379,9 +3332,9 @@ function system_config_form($form, &$form_state) {
   }
   $form['#submit'][] = 'system_config_form_submit';
 
-  // By default, render the form using theme_system_settings_form().
+  // By default, render the form using theme_system_config_form().
   if (!isset($form['#theme'])) {
-    $form['#theme'] = 'system_settings_form';
+    $form['#theme'] = 'system_config_form';
   }
   return $form;
 }
@@ -3969,7 +3922,7 @@ function theme_confirm_form($variables) {
  *
  * @ingroup themeable
  */
-function theme_system_settings_form($variables) {
+function theme_system_config_form($variables) {
   return drupal_render_children($variables['form']);
 }
 
-- 
GitLab