Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ACF’s picture

Status: Active » Needs review
FileSize
6.23 KB
ACF’s picture

Change the patch to use the moduleHandler.

franskuipers’s picture

Issue tags: +SprintWeekend2013

Lets get some #sprintweekend attention

tim.plunkett’s picture

Status: Needs review » Needs work
+++ b/core/modules/statistics/lib/Drupal/statistics/StatisticsBundle.phpundefined
@@ -0,0 +1,19 @@
+<?php
+
+namespace Drupal\statistics;
+
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Reference;
+use Symfony\Component\HttpKernel\Bundle\Bundle;
+
+class StatisticsBundle extends Bundle {
+
+  /**
+   * Implements \Symfony\Component\HttpKernel\Bundle\BundleInterface::build().
+   */
+  function build(ContainerBuilder $container) {
+    $container->register('statistics.form.settings', 'Drupal\statistics\StatisticsSettingsForm')
+      ->addArgument(new Reference('config.factory'))
+      ->addArgument(new Reference('module_handler'));
+  }
+}
diff --git a/core/modules/statistics/lib/Drupal/statistics/StatisticsSettingsForm.php b/core/modules/statistics/lib/Drupal/statistics/StatisticsSettingsForm.php

You don't need this for controllers anymore, see #1915774: Decide whether core route controllers should generally/always be DIC services or not

+++ b/core/modules/statistics/lib/Drupal/statistics/StatisticsSettingsForm.phpundefined
@@ -0,0 +1,97 @@
+   * Stores the configuration factory.
+   *
+   * @var \Drupal\Core\Config\ConfigFactory
+   */
+  protected $configFactory;

This is provided by the base class

+++ b/core/modules/statistics/lib/Drupal/statistics/StatisticsSettingsForm.phpundefined
@@ -0,0 +1,97 @@
+  /**
+   * Returns an instance of this form.
+   */
+  public function getForm() {
+    return drupal_get_form($this);

+++ b/core/modules/statistics/statistics.routing.ymlundefined
@@ -0,0 +1,6 @@
+    _controller: 'statistics.form.settings:getForm'

This should be removed in favor of _form, see #1925738: Convert language's system_config_form() to SystemConfigFormBase and #1934832: Provide a dedicated approach for using forms in routes

ACF’s picture

Status: Needs work » Needs review
FileSize
5.78 KB

Made those changes.

Crell’s picture

Status: Needs review » Needs work
+++ b/core/modules/statistics/statistics.module
@@ -79,10 +79,8 @@ function statistics_menu() {
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('statistics_settings_form'),
+    'page callback' => 'NOT_USED',

You guessed it, this should now be a route key. :-) (The patch only went in last night.)

ACF’s picture

Status: Needs work » Needs review
FileSize
5.78 KB

Updated.

Crell’s picture

Status: Needs review » Reviewed & tested by the community

Another one bites the dust.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Awesome!

Committed and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.