diff --git a/core/modules/node/lib/Drupal/node/Controller/NodeController.php b/core/modules/node/lib/Drupal/node/Controller/NodeController.php index 3589894434304c34223e7914916fff31fd352b1a..a60696ccbb150851e39a6fff7010b99b34669072 100644 --- a/core/modules/node/lib/Drupal/node/Controller/NodeController.php +++ b/core/modules/node/lib/Drupal/node/Controller/NodeController.php @@ -43,7 +43,7 @@ public function addPage() { // Bypass the node/add listing if only one content type is available. if (count($content) == 1) { $type = array_shift($content); - return $this->redirect('node_add', array('node_type' => $type->type)); + return $this->redirect('node.add', array('node_type' => $type->type)); } return array( diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php index 71e07de061134e784784a0924e68d2feca28b82f..c443f985fdd053715fbd6637e758868ebe2e1148 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php @@ -43,6 +43,11 @@ function setUp() { * Creates a "Basic page" node and verifies its consistency in the database. */ function testNodeCreation() { + // Test /node/add page with only one content type. + entity_load('node_type', 'article')->delete(); + $this->drupalGet('node/add'); + $this->assertResponse(200); + $this->assertUrl('node/add/page'); // Create a node. $edit = array(); $edit['title[0][value]'] = $this->randomName(8);