From 2575651a83dd15ba6ad6925a2ce416fa6f7733af Mon Sep 17 00:00:00 2001
From: webchick <webchick@24967.no-reply.drupal.org>
Date: Wed, 23 Jan 2013 10:12:39 -0800
Subject: [PATCH] Issue #1893336 by dawehner: Fixed Views Machine name field
 does not work.

---
 .../views/lib/Drupal/views/Tests/Wizard/BasicTest.php | 11 +++++++++++
 .../lib/Drupal/views_ui/ViewAddFormController.php     |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

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 07ba15ed27e3..b786859546e9 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 e878f0b7a62e..ca6478d641d2 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.'),
     );
-- 
GitLab