diff --git a/core/lib/Drupal/Core/Form/FormBuilder.php b/core/lib/Drupal/Core/Form/FormBuilder.php index 96ecbd9..014f838 100644 --- a/core/lib/Drupal/Core/Form/FormBuilder.php +++ b/core/lib/Drupal/Core/Form/FormBuilder.php @@ -686,6 +686,10 @@ public function prepareForm($form_id, &$form, FormStateInterface &$form_state) { */ protected function buildFormAction() { $request = $this->requestStack->getMasterRequest(); + if (drupal_installation_attempted()) { + return $request->getRequestUri(); + } + $query = $request->query->all(); // @todo Remove this unset() once these are removed from the request in // https://www.drupal.org/node/2504709. diff --git a/core/modules/dblog/src/Tests/DbLogFormInjectionTest.php b/core/modules/dblog/src/Tests/DbLogFormInjectionTest.php index e622fe2..af69263 100644 --- a/core/modules/dblog/src/Tests/DbLogFormInjectionTest.php +++ b/core/modules/dblog/src/Tests/DbLogFormInjectionTest.php @@ -83,8 +83,10 @@ public function submitForm(array &$form, FormStateInterface $form_state) { protected function setUp() { parent::setUp(); $this->installSchema('dblog', ['watchdog']); - $this->installSchema('system', ['key_value_expire', 'sequences']); + $this->installSchema('system', ['key_value_expire', 'router', 'sequences']); $this->installEntitySchema('user'); + \Drupal::service('router.builder')->rebuild(); + $this->logger = \Drupal::logger('test_logger'); $test_user = User::create(array( 'name' => 'foobar', diff --git a/core/modules/system/src/Tests/Form/FormDefaultHandlersTest.php b/core/modules/system/src/Tests/Form/FormDefaultHandlersTest.php index 94187af..de3b596 100644 --- a/core/modules/system/src/Tests/Form/FormDefaultHandlersTest.php +++ b/core/modules/system/src/Tests/Form/FormDefaultHandlersTest.php @@ -31,7 +31,8 @@ class FormDefaultHandlersTest extends KernelTestBase implements FormInterface { */ protected function setUp() { parent::setUp(); - $this->installSchema('system', ['key_value_expire']); + $this->installSchema('system', ['key_value_expire', 'router']); + \Drupal::service('router.builder')->rebuild(); } /** diff --git a/core/modules/system/src/Tests/Form/TriggeringElementProgrammedUnitTest.php b/core/modules/system/src/Tests/Form/TriggeringElementProgrammedUnitTest.php index ae6b82c..1684850 100644 --- a/core/modules/system/src/Tests/Form/TriggeringElementProgrammedUnitTest.php +++ b/core/modules/system/src/Tests/Form/TriggeringElementProgrammedUnitTest.php @@ -19,11 +19,24 @@ */ class TriggeringElementProgrammedUnitTest extends KernelTestBase implements FormInterface { + /** + * {@inheritdoc} + */ public static $modules = array('system'); /** * {@inheritdoc} */ + protected function setUp() { + parent::setUp(); + + $this->installSchema('system', ['router']); + \Drupal::service('router.builder')->rebuild(); + } + + /** + * {@inheritdoc} + */ public function getFormId() { return 'triggering_element_programmed_form'; } diff --git a/core/modules/system/src/Tests/Queue/QueueSerializationTest.php b/core/modules/system/src/Tests/Queue/QueueSerializationTest.php index 9108ac2..584d8ba 100644 --- a/core/modules/system/src/Tests/Queue/QueueSerializationTest.php +++ b/core/modules/system/src/Tests/Queue/QueueSerializationTest.php @@ -81,8 +81,10 @@ public function submitForm(array &$form, FormStateInterface $form_state) { */ protected function setUp() { parent::setUp(); - $this->installSchema('system', ['key_value_expire', 'sequences', 'queue']); + $this->installSchema('system', ['key_value_expire', 'router', 'sequences', 'queue']); $this->installEntitySchema('user'); + \Drupal::service('router.builder')->rebuild(); + $this->queue = \Drupal::service('queue.database')->get('aggregator_refresh'); $test_user = User::create(array( 'name' => 'foobar', diff --git a/core/modules/user/src/Tests/UserAccountFormFieldsTest.php b/core/modules/user/src/Tests/UserAccountFormFieldsTest.php index 679eec0..0e22d19 100644 --- a/core/modules/user/src/Tests/UserAccountFormFieldsTest.php +++ b/core/modules/user/src/Tests/UserAccountFormFieldsTest.php @@ -26,6 +26,16 @@ class UserAccountFormFieldsTest extends KernelTestBase { public static $modules = array('system', 'user', 'field'); /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + + $this->installSchema('system', ['router']); + \Drupal::service('router.builder')->rebuild(); + } + + /** * Tests the root user account form section in the "Configure site" form. */ function testInstallConfigureForm() { @@ -78,10 +88,6 @@ function testUserEditForm() { // Install default configuration; required for AccountFormController. $this->installConfig(array('user')); - // Install the router table and then rebuild. - $this->installSchema('system', ['router']); - \Drupal::service('router.builder')->rebuild(); - $form = $this->buildAccountForm('default'); // Verify name and pass field order.