diff --git a/core/modules/views/lib/Drupal/views/Tests/Wizard/BasicTest.php b/core/modules/views/lib/Drupal/views/Tests/Wizard/BasicTest.php index 07ba15ed27e36e31035238a112f023b0f86709da..b786859546e94f19c3ebe880b5ab1a50e8d91cb1 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Wizard/BasicTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Wizard/BasicTest.php @@ -139,4 +139,15 @@ function testViewsWizardAndListing() { $this->assertNoText('tracker', t('Default tracker view does not show on the listing page.')); } + /** + * Tests the actual wizard form. + * + * @see \Drupal\views_ui\ViewAddFormController::form() + */ + protected function testWizardForm() { + $this->drupalGet('admin/structure/views/add'); + + $result = $this->xpath('//small[@id = "edit-human-name-machine-name-suffix"]'); + $this->assertTrue(count($result), 'Ensure that the machine name is applied to the name field.'); + } } diff --git a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewAddFormController.php b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewAddFormController.php index e878f0b7a62e244cdc1fd30efb6a603d68f97b17..ca6478d641d23ad9460aaf4b273295c5f611bc4d 100644 --- a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewAddFormController.php +++ b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewAddFormController.php @@ -49,7 +49,7 @@ public function form(array $form, array &$form_state, EntityInterface $view) { '#maxlength' => 128, '#machine_name' => array( 'exists' => 'views_get_view', - 'source' => array('id', 'human_name'), + 'source' => array('name', 'human_name'), ), '#description' => t('A unique machine-readable name for this View. It must only contain lowercase letters, numbers, and underscores.'), );