commit 0d91b0441ec093fb59467be2d34ccbb4ed2e3870
Author: Bart Feenstra <bart@mynameisbart.com>
Date:   Tue Feb 25 09:10:30 2014 +0100

    foo

diff --git a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php
index 704a078..d23229f 100644
--- a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php
+++ b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php
@@ -14,6 +14,7 @@
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\FormBase;
 use Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface;
+use Drupal\Core\Session\AccountInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Drupal\Core\Access\AccessManager;
 
@@ -28,6 +29,13 @@
 class ModulesListForm extends FormBase {
 
   /**
+   * The current user.
+   *
+   * @var \Drupal\Core\Session\AccountInterface
+   */
+  protected $currentUser;
+
+  /**
    * The module handler service.
    *
    * @var \Drupal\Core\Extension\ModuleHandlerInterface
@@ -64,7 +72,8 @@ public static function create(ContainerInterface $container) {
       $container->get('keyvalue.expirable')->get('module_list'),
       $container->get('access_manager'),
       $container->get('entity.manager'),
-      $container->get('entity.query')
+      $container->get('entity.query'),
+      $container->get('current_user')
     );
   }
 
@@ -81,13 +90,16 @@ public static function create(ContainerInterface $container) {
    *   The entity manager.
    * @param \Drupal\Core\Entity\Query\QueryFactory $query_factory
    *   The entity query factory.
+   * @param \Drupal\Core\Session\AccountInterface $current_user
+   *   The current user.
    */
-  public function __construct(ModuleHandlerInterface $module_handler, KeyValueStoreExpirableInterface $key_value_expirable, AccessManager $access_manager, EntityManagerInterface $entity_manager, QueryFactory $query_factory) {
+  public function __construct(ModuleHandlerInterface $module_handler, KeyValueStoreExpirableInterface $key_value_expirable, AccessManager $access_manager, EntityManagerInterface $entity_manager, QueryFactory $query_factory, AccountInterface $current_user) {
     $this->moduleHandler = $module_handler;
     $this->keyValueExpirable = $key_value_expirable;
     $this->accessManager = $access_manager;
     $this->entityManager = $entity_manager;
     $this->queryFactory = $query_factory;
+    $this->currentUser = $current_user;
   }
 
   /**
@@ -223,7 +235,8 @@ protected function buildRow(array $modules, $module, $distribution) {
     // Generate link for module's configuration page, if it has one.
     $row['links']['configure'] = array();
     if ($module->status && isset($module->info['configure'])) {
-      if ($this->accessManager->checkNamedRoute($module->info['configure'], array(), \Drupal::currentUser())) {
+      $route_parameters = isset($module->info['configure_parameters']) ? $module->info['configure_parameters'] : array();
+      if ($this->accessManager->checkNamedRoute($module->info['configure'], $route_parameters, $this->currentUser)) {
         $result = $this->queryFactory->get('menu_link')
           ->condition('route_name', $module->info['configure'])
           ->execute();
@@ -233,6 +246,7 @@ protected function buildRow(array $modules, $module, $distribution) {
           '#type' => 'link',
           '#title' => $this->t('Configure'),
           '#route_name' => $module->info['configure'],
+          '#route_parameters' => $route_parameters,
           '#options' => array(
             'attributes' => array(
               'class' => array('module-link', 'module-link-configure'),
diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/ModulesListFormWebTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/ModulesListFormWebTest.php
new file mode 100644
index 0000000..934a416
--- /dev/null
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/ModulesListFormWebTest.php
@@ -0,0 +1,52 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\system\Form\ModulesListFormWebTest.
+ */
+
+namespace Drupal\system\Tests\Form;
+
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Tests \Drupal\system\Form\ModulesListForm.
+ */
+class ModulesListFormWebTest extends WebTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = array('system_test');
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function getInfo() {
+    return array(
+      'description' => 'Tests \Drupal\system\Form\ModulesListForm.',
+      'name' => '\Drupal\system\Form\ModulesListForm web test',
+      'group' => 'Module',
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp() {
+    parent::setUp();
+    \Drupal::state()->set('system_test.module_hidden', FALSE);
+  }
+
+  /**
+   * Tests the module list form.
+   */
+  public function testModuleListForm() {
+    $this->drupalLogin($this->drupalCreateUser(array('administer modules')));
+    $this->drupalGet('admin/modules');
+    $this->assertResponse('200');
+
+    // Check that system_test's configure link was rendered correctly.
+    $this->assertLinkByHref('configure/bar');
+  }
+}
diff --git a/core/modules/system/tests/modules/system_test/system_test.info.yml b/core/modules/system/tests/modules/system_test/system_test.info.yml
index d5b65e9..eff3630 100644
--- a/core/modules/system/tests/modules/system_test/system_test.info.yml
+++ b/core/modules/system/tests/modules/system_test/system_test.info.yml
@@ -5,3 +5,6 @@ package: Testing
 version: VERSION
 core: 8.x
 hidden: true
+configure: system_test.configure
+configure_parameters:
+  foo: bar
diff --git a/core/modules/system/tests/modules/system_test/system_test.module b/core/modules/system/tests/modules/system_test/system_test.module
index 1eda491..339141f 100644
--- a/core/modules/system/tests/modules/system_test/system_test.module
+++ b/core/modules/system/tests/modules/system_test/system_test.module
@@ -69,6 +69,9 @@ function system_test_system_info_alter(&$info, $file, $type) {
   if ($file->name == 'requirements1_test' || $file->name == 'requirements2_test') {
     $info['hidden'] = FALSE;
   }
+  if ($file->name == 'system_test') {
+    $info['hidden'] = \Drupal::state()->get('system_test.module_hidden', TRUE);
+  }
 }
 
 /**
diff --git a/core/modules/system/tests/modules/system_test/system_test.routing.yml b/core/modules/system/tests/modules/system_test/system_test.routing.yml
index 27812fb..cd070ac 100644
--- a/core/modules/system/tests/modules/system_test/system_test.routing.yml
+++ b/core/modules/system/tests/modules/system_test/system_test.routing.yml
@@ -72,3 +72,8 @@ system_test.shutdown_functions:
     _content: '\Drupal\system_test\Controller\SystemTestController::shutdownFunctions'
   requirements:
     _access: 'TRUE'
+
+system_test.configure:
+  path: '/system-test/configure/{foo}'
+  requirements:
+    _access: 'TRUE'
