diff --git a/core/lib/Drupal/Core/Controller/HtmlFormController.php b/core/lib/Drupal/Core/Controller/HtmlFormController.php
index 96530d5..68b6c31 100644
--- a/core/lib/Drupal/Core/Controller/HtmlFormController.php
+++ b/core/lib/Drupal/Core/Controller/HtmlFormController.php
@@ -57,10 +57,12 @@ public function content(Request $request, $_form) {
$request->attributes->set('form', array());
$request->attributes->set('form_state', $form_state);
$args = $this->container->get('controller_resolver')->getArguments($request, array($form_object, 'buildForm'));
- unset($args[0], $args[1]);
$request->attributes->remove('form');
$request->attributes->remove('form_state');
- $form_state['build_info']['args'] = $args;
+
+ // Remove $form and $form_state from the arguments, and re-index them.
+ unset($args[0], $args[1]);
+ $form_state['build_info']['args'] = array_values($args);
$form_id = _drupal_form_id($form_object, $form_state);
$form = drupal_build_form($form_id, $form_state);
diff --git a/core/modules/color/color.module b/core/modules/color/color.module
index a11e035..2203133 100644
--- a/core/modules/color/color.module
+++ b/core/modules/color/color.module
@@ -37,7 +37,7 @@ function color_theme() {
* Implements hook_form_FORM_ID_alter().
*/
function color_form_system_theme_settings_alter(&$form, &$form_state) {
- if (isset($form_state['build_info']['args'][2]) && ($theme = $form_state['build_info']['args'][2]) && color_get_info($theme) && function_exists('gd_info')) {
+ if (isset($form_state['build_info']['args'][0]) && ($theme = $form_state['build_info']['args'][0]) && color_get_info($theme) && function_exists('gd_info')) {
$form['color'] = array(
'#type' => 'details',
'#title' => t('Color scheme'),
diff --git a/core/modules/system/lib/Drupal/system/Form/ThemeSettingsForm.php b/core/modules/system/lib/Drupal/system/Form/ThemeSettingsForm.php
index 26e8142..903c4f5 100644
--- a/core/modules/system/lib/Drupal/system/Form/ThemeSettingsForm.php
+++ b/core/modules/system/lib/Drupal/system/Form/ThemeSettingsForm.php
@@ -21,14 +21,21 @@
class ThemeSettingsForm extends SystemConfigFormBase {
/**
- * The module handler
+ * The module handler.
*
- * @var \Drupal\Core\Extension\ModuleHandler
+ * @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected $moduleHandler;
/**
- * {@inheritdoc}
+ * Constructs a ThemeSettingsForm object.
+ *
+ * @param \Drupal\Core\Config\ConfigFactory $config_factory
+ * The factory for configuration objects.
+ * @param \Drupal\Core\Config\Context\ContextInterface $context
+ * The configuration context to use.
+ * @param Drupal\Core\Extension\ModuleHandlerInterface
+ * The module handler instance to use.
*/
public function __construct(ConfigFactory $config_factory, ContextInterface $context, ModuleHandlerInterface $module_handler) {
parent::__construct($config_factory, $context);
@@ -92,15 +99,15 @@ public function buildForm(array $form, array &$form_state, $theme_name = '') {
// Toggle settings
$toggles = array(
- 'logo' => t('Logo'),
- 'name' => t('Site name'),
- 'slogan' => t('Site slogan'),
- 'node_user_picture' => t('User pictures in posts'),
- 'comment_user_picture' => t('User pictures in comments'),
+ 'logo' => t('Logo'),
+ 'name' => t('Site name'),
+ 'slogan' => t('Site slogan'),
+ 'node_user_picture' => t('User pictures in posts'),
+ 'comment_user_picture' => t('User pictures in comments'),
'comment_user_verification' => t('User verification status in comments'),
- 'favicon' => t('Shortcut icon'),
- 'main_menu' => t('Main menu'),
- 'secondary_menu' => t('Secondary menu'),
+ 'favicon' => t('Shortcut icon'),
+ 'main_menu' => t('Main menu'),
+ 'secondary_menu' => t('Secondary menu'),
);
// Some features are not always available