diff --git a/core/modules/node/lib/Drupal/node/Controller/NodeController.php b/core/modules/node/lib/Drupal/node/Controller/NodeController.php index 4267101..92733fb 100644 --- a/core/modules/node/lib/Drupal/node/Controller/NodeController.php +++ b/core/modules/node/lib/Drupal/node/Controller/NodeController.php @@ -153,7 +153,7 @@ protected function buildPage(NodeInterface $node) { * The page title. */ public function addPageTitle(NodeTypeInterface $node_type) { - return $this->t('Create @name', array('@name' => $node_type->type)); + return $this->t('Create @name', array('@name' => $node_type->label())); } } diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php index 5589b1c..f956965 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php @@ -51,17 +51,18 @@ function testNodeTypeGetFunctions() { */ function testNodeTypeCreation() { // Create a content type programmaticaly. - $type = $this->drupalCreateContentType(); + $type = $this->drupalCreateContentType(array('name' => $this->randomName())); $type_exists = (bool) entity_load('node_type', $type->type); $this->assertTrue($type_exists, 'The new content type has been created in the database.'); // Login a test user. - $web_user = $this->drupalCreateUser(array('create ' . $type->name . ' content')); + $web_user = $this->drupalCreateUser(array('create ' . $type->type . ' content')); $this->drupalLogin($web_user); $this->drupalGet('node/add/' . $type->type); $this->assertResponse(200, 'The new content type can be accessed at node/add.'); + $this->assertTitle(t('Create @name', array('@name' => $type->label())) . ' | Drupal'); // Create a content type via the user interface. $web_user = $this->drupalCreateUser(array('bypass node access', 'administer content types'));