summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2014-06-11 22:25:37 (GMT)
committerAlex Pott2014-06-11 22:26:24 (GMT)
commitc723131b151f69d0fce64b05f662ebbb36d64e97 (patch)
tree9f5f6dea99cd5e744f3e5e81d9c375095eb845f6
parent130cbfb0b547d6588f20f1eb9ed5940dec2ce3dc (diff)
Issue #2229163 by Michael Hodge Jr, rixter, thechanceg, bburg | Berdir: Remove node_type->has_title.
-rw-r--r--core/modules/book/config/install/node.type.book.yml1
-rw-r--r--core/modules/forum/config/install/node.type.forum.yml1
-rw-r--r--core/modules/migrate_drupal/config/install/migrate.migration.d6_node_type.yml1
-rw-r--r--core/modules/migrate_drupal/src/Plugin/migrate/source/d6/NodeType.php2
-rw-r--r--core/modules/migrate_drupal/tests/src/source/d6/NodeTypeTest.php2
-rw-r--r--core/modules/node/config/schema/node.schema.yml3
-rw-r--r--core/modules/node/node.module5
-rw-r--r--core/modules/node/src/Entity/NodeType.php9
-rw-r--r--core/modules/node/src/NodeTypeForm.php11
-rw-r--r--core/modules/node/tests/modules/node_test_config/config/install/node.type.default.yml1
-rw-r--r--core/modules/node/tests/modules/node_test_config/staging/node.type.import.yml1
-rw-r--r--core/modules/system/entity.api.php7
-rw-r--r--core/profiles/standard/config/install/node.type.article.yml1
-rw-r--r--core/profiles/standard/config/install/node.type.page.yml1
14 files changed, 0 insertions, 46 deletions
diff --git a/core/modules/book/config/install/node.type.book.yml b/core/modules/book/config/install/node.type.book.yml
index e7ad5f7..d2409d4 100644
--- a/core/modules/book/config/install/node.type.book.yml
+++ b/core/modules/book/config/install/node.type.book.yml
@@ -2,7 +2,6 @@ type: book
name: 'Book page'
description: '<em>Books</em> have a built-in hierarchical navigation. Use for handbooks or tutorials.'
help: ''
-has_title: true
title_label: Title
settings:
node:
diff --git a/core/modules/forum/config/install/node.type.forum.yml b/core/modules/forum/config/install/node.type.forum.yml
index 011600f..f2e86af 100644
--- a/core/modules/forum/config/install/node.type.forum.yml
+++ b/core/modules/forum/config/install/node.type.forum.yml
@@ -2,7 +2,6 @@ type: forum
name: 'Forum topic'
description: 'A <em>forum topic</em> starts a new discussion thread within a forum.'
help: ''
-has_title: true
title_label: Subject
settings:
node:
diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_type.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_type.yml
index ce4e9e8..fe91810 100644
--- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_type.yml
+++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_type.yml
@@ -11,7 +11,6 @@ process:
module: module
description: description
help: help
- has_title: has_title
title_label: title_label
preview: constants.preview
submitted: submitted
diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/NodeType.php b/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/NodeType.php
index 4120de3..592f8b8 100644
--- a/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/NodeType.php
+++ b/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/NodeType.php
@@ -51,7 +51,6 @@ class NodeType extends DrupalSqlBase {
'module',
'description',
'help',
- 'has_title',
'title_label',
'has_body',
'body_label',
@@ -74,7 +73,6 @@ class NodeType extends DrupalSqlBase {
'module' => $this->t('The module providing the node type.'),
'description' => $this->t('Description of the node type.'),
'help' => $this->t('Help text for the node type.'),
- 'has_title' => $this->t('Flag indicating the node type has a title.'),
'title_label' => $this->t('Title label.'),
'has_body' => $this->t('Flag indicating the node type has a body field.'),
'body_label' => $this->t('Body label.'),
diff --git a/core/modules/migrate_drupal/tests/src/source/d6/NodeTypeTest.php b/core/modules/migrate_drupal/tests/src/source/d6/NodeTypeTest.php
index e38aba6..ab22f18 100644
--- a/core/modules/migrate_drupal/tests/src/source/d6/NodeTypeTest.php
+++ b/core/modules/migrate_drupal/tests/src/source/d6/NodeTypeTest.php
@@ -41,7 +41,6 @@ class NodeTypeTest extends MigrateSqlSourceTestCase {
'module' => 'node',
'description' => 'A <em>page</em>, similar in form to a <em>story</em>, is a simple method for creating and displaying information that rarely changes, such as an "About us" section of a website. By default, a <em>page</em> entry does not allow visitor comments and is not featured on the site\'s initial home page.',
'help' => '',
- 'has_title' => 1,
'title_label' => 'Title',
'has_body' => 1,
'body_label' => 'Body',
@@ -57,7 +56,6 @@ class NodeTypeTest extends MigrateSqlSourceTestCase {
'module' => 'node',
'description' => 'A <em>story</em>, similar in form to a <em>page</em>, is ideal for creating and displaying content that informs or engages website visitors. Press releases, site announcements, and informal blog-like entries may all be created with a <em>story</em> entry. By default, a <em>story</em> entry is automatically featured on the site\'s initial home page, and provides the ability to post comments.',
'help' => '',
- 'has_title' => 1,
'title_label' => 'Title',
'has_body' => 1,
'body_label' => 'Body',
diff --git a/core/modules/node/config/schema/node.schema.yml b/core/modules/node/config/schema/node.schema.yml
index 8ebe374..81e0977 100644
--- a/core/modules/node/config/schema/node.schema.yml
+++ b/core/modules/node/config/schema/node.schema.yml
@@ -27,9 +27,6 @@ node.type.*:
help:
type: text
label: 'Explanation or submission guidelines'
- has_title:
- type: boolean
- label: 'Has title'
title_label:
type: label
label: 'Title field label'
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index 45c3043..d4f7db0 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -209,11 +209,6 @@ function node_entity_view_display_alter(EntityViewDisplayInterface $display, $co
function node_entity_form_display_alter(EntityFormDisplayInterface $form_display, $context) {
if ($context['entity_type'] == 'node') {
$node_type = node_type_load($context['bundle']);
- // @todo Reconsider when per-bundle overrides of field definitions are
- // possible - https://drupal.org/node/2114707.
- if (!$node_type->has_title) {
- $form_display->removeComponent('title');
- }
}
}
diff --git a/core/modules/node/src/Entity/NodeType.php b/core/modules/node/src/Entity/NodeType.php
index 2c7d3b2..ecc21ea 100644
--- a/core/modules/node/src/Entity/NodeType.php
+++ b/core/modules/node/src/Entity/NodeType.php
@@ -76,15 +76,6 @@ class NodeType extends ConfigEntityBundleBase implements NodeTypeInterface {
public $help;
/**
- * Indicates whether the Node entity of this type has a title.
- *
- * @var bool
- *
- * @todo Rename to $node_has_title.
- */
- public $has_title = TRUE;
-
- /**
* The label to use for the title of a Node of this type in the user interface.
*
* @var string
diff --git a/core/modules/node/src/NodeTypeForm.php b/core/modules/node/src/NodeTypeForm.php
index 4d87e03..ec00d50 100644
--- a/core/modules/node/src/NodeTypeForm.php
+++ b/core/modules/node/src/NodeTypeForm.php
@@ -83,13 +83,6 @@ class NodeTypeForm extends EntityForm {
'#default_value' => $type->title_label,
'#required' => TRUE,
);
- if (!$type->has_title) {
- // Avoid overwriting a content type that intentionally does not have a
- // title field.
- $form['submission']['title_label']['#attributes'] = array('disabled' => 'disabled');
- $form['submission']['title_label']['#description'] = t('This content type does not have a title field.');
- $form['submission']['title_label']['#required'] = FALSE;
- }
$form['submission']['preview'] = array(
'#type' => 'radios',
'#title' => t('Preview before submitting'),
@@ -187,10 +180,6 @@ class NodeTypeForm extends EntityForm {
$type->type = trim($type->id());
$type->name = trim($type->name);
- // title_label is required in core; has_title will always be TRUE, unless a
- // module alters the title field.
- $type->has_title = ($type->title_label != '');
-
$status = $type->save();
$t_args = array('%name' => $type->label());
diff --git a/core/modules/node/tests/modules/node_test_config/config/install/node.type.default.yml b/core/modules/node/tests/modules/node_test_config/config/install/node.type.default.yml
index e28a0e4..824ec4e 100644
--- a/core/modules/node/tests/modules/node_test_config/config/install/node.type.default.yml
+++ b/core/modules/node/tests/modules/node_test_config/config/install/node.type.default.yml
@@ -2,7 +2,6 @@ type: default
name: Default
description: 'Default description.'
help: ''
-has_title: true
title_label: Title
settings:
node:
diff --git a/core/modules/node/tests/modules/node_test_config/staging/node.type.import.yml b/core/modules/node/tests/modules/node_test_config/staging/node.type.import.yml
index 214e53a..c88d9a8 100644
--- a/core/modules/node/tests/modules/node_test_config/staging/node.type.import.yml
+++ b/core/modules/node/tests/modules/node_test_config/staging/node.type.import.yml
@@ -2,7 +2,6 @@ type: import
name: Import
description: 'Import description.'
help: ''
-has_title: true
title_label: Title
settings:
node:
diff --git a/core/modules/system/entity.api.php b/core/modules/system/entity.api.php
index 50b9f6a..ddc302a 100644
--- a/core/modules/system/entity.api.php
+++ b/core/modules/system/entity.api.php
@@ -984,13 +984,6 @@ function hook_entity_extra_field_info() {
$description = t('Node module element');
foreach (node_type_get_types() as $bundle) {
- if ($bundle->has_title) {
- $extra['node'][$bundle->type]['form']['title'] = array(
- 'label' => String::checkPlain($bundle->title_label),
- 'description' => $description,
- 'weight' => -5,
- );
- }
// Add also the 'language' select if Language module is enabled and the
// bundle has multilingual support.
diff --git a/core/profiles/standard/config/install/node.type.article.yml b/core/profiles/standard/config/install/node.type.article.yml
index 2c58ec6..b7a7f6b 100644
--- a/core/profiles/standard/config/install/node.type.article.yml
+++ b/core/profiles/standard/config/install/node.type.article.yml
@@ -2,7 +2,6 @@ type: article
name: Article
description: 'Use <em>articles</em> for time-sensitive content like news, press releases or blog posts.'
help: ''
-has_title: true
title_label: Title
settings:
node:
diff --git a/core/profiles/standard/config/install/node.type.page.yml b/core/profiles/standard/config/install/node.type.page.yml
index f72d0c6..1c9cdfe 100644
--- a/core/profiles/standard/config/install/node.type.page.yml
+++ b/core/profiles/standard/config/install/node.type.page.yml
@@ -2,7 +2,6 @@ type: page
name: 'Basic page'
description: 'Use <em>basic pages</em> for your static content, such as an ''About us'' page.'
help: ''
-has_title: true
title_label: Title
settings:
node: