Skip to content
Snippets Groups Projects
Commit c723131b authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2229163 by Michael Hodge Jr, rixter, thechanceg, bburg | Berdir: Remove...

Issue #2229163 by Michael Hodge Jr, rixter, thechanceg, bburg | Berdir: Remove node_type->has_title.
parent 130cbfb0
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 46 deletions
......@@ -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:
......
......@@ -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:
......
......@@ -11,7 +11,6 @@ process:
module: module
description: description
help: help
has_title: has_title
title_label: title_label
preview: constants.preview
submitted: submitted
......
......@@ -51,7 +51,6 @@ public function query() {
'module',
'description',
'help',
'has_title',
'title_label',
'has_body',
'body_label',
......@@ -74,7 +73,6 @@ public function fields() {
'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.'),
......
......@@ -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',
......
......@@ -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'
......
......@@ -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');
}
}
}
......
......@@ -75,15 +75,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.
*
......
......@@ -83,13 +83,6 @@ public function form(array $form, array &$form_state) {
'#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 @@ public function save(array $form, array &$form_state) {
$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());
......
......@@ -2,7 +2,6 @@ type: default
name: Default
description: 'Default description.'
help: ''
has_title: true
title_label: Title
settings:
node:
......
......@@ -2,7 +2,6 @@ type: import
name: Import
description: 'Import description.'
help: ''
has_title: true
title_label: Title
settings:
node:
......
......@@ -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.
......
......@@ -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:
......
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment