Commit b7959a1d authored by alexpott's avatar alexpott

Issue #2292821 by andypost, larowlan: Use widget for comment subject field.

parent 08c9054e
......@@ -118,11 +118,6 @@ function comment_entity_extra_field_info() {
'description' => t('Author textfield'),
'weight' => -2,
),
'subject' => array(
'label' => t('Subject'),
'description' => t('Subject textfield'),
'weight' => -1,
),
),
);
}
......
......@@ -106,9 +106,6 @@ field.comment.instance_settings:
anonymous:
type: integer
label: 'Mode'
subject:
type: boolean
label: 'Allow comment title'
form_location:
type: boolean
label: ' Allow comment title'
......
......@@ -206,14 +206,6 @@ public function form(array $form, array &$form_state) {
'#access' => $is_admin,
);
$form['subject'] = array(
'#type' => 'textfield',
'#title' => $this->t('Subject'),
'#maxlength' => 64,
'#default_value' => $comment->getSubject(),
'#access' => $field_definition->getSetting('subject'),
);
// Used for conditional validation of author fields.
$form['is_anonymous'] = array(
'#type' => 'value',
......
......@@ -225,9 +225,14 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
$fields['subject'] = FieldDefinition::create('string')
->setLabel(t('Subject'))
->setDescription(t('The comment title or subject.'))
->setTranslatable(TRUE)
->setSetting('max_length', 64);
->setSetting('max_length', 64)
->setDisplayOptions('form', array(
'type' => 'string',
// Default comment body field has weight 20.
'weight' => 10,
))
->setDisplayConfigurable('form', TRUE);
$fields['uid'] = FieldDefinition::create('entity_reference')
->setLabel(t('User ID'))
......
......@@ -45,7 +45,6 @@ public static function defaultInstanceSettings() {
'per_page' => 50,
'form_location' => COMMENT_FORM_BELOW,
'anonymous' => COMMENT_ANONYMOUS_MAYNOT_CONTACT,
'subject' => 1,
'preview' => DRUPAL_OPTIONAL,
) + parent::defaultInstanceSettings();
}
......@@ -143,11 +142,6 @@ public function instanceSettingsForm(array $form, array &$form_state) {
),
'#access' => $anonymous_user->hasPermission('post comments'),
);
$element['comment']['subject'] = array(
'#type' => 'checkbox',
'#title' => t('Allow comment title'),
'#default_value' => $settings['subject'],
);
$element['comment']['form_location'] = array(
'#type' => 'checkbox',
'#title' => t('Show reply form on the same page as comments'),
......
......@@ -63,7 +63,7 @@ function testAnonymous() {
$edit = array(
'name' => $this->admin_user->getUsername(),
'mail' => $this->randomName() . '@example.com',
'subject' => $this->randomName(),
'subject[0][value]' => $this->randomName(),
'comment_body[0][value]' => $this->randomName(),
);
$this->drupalPostForm('comment/reply/node/' . $this->node->id() . '/comment', $edit, t('Save'));
......@@ -131,7 +131,7 @@ function testAnonymous() {
// Attempt to view node-comment form while disallowed.
$this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment');
$this->assertText('You are not authorized to post comments', 'Error attempting to post comment.');
$this->assertNoFieldByName('subject', '', 'Subject field not found.');
$this->assertNoFieldByName('subject[0][value]', '', 'Subject field not found.');
$this->assertNoFieldByName('comment_body[0][value]', '', 'Comment field not found.');
user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array(
......@@ -151,7 +151,7 @@ function testAnonymous() {
));
$this->drupalGet('node/' . $this->node->id());
$this->assertNoPattern('@<h2[^>]*>Comments</h2>@', 'Comments were not displayed.');
$this->assertFieldByName('subject', '', 'Subject field found.');
$this->assertFieldByName('subject[0][value]', '', 'Subject field found.');
$this->assertFieldByName('comment_body[0][value]', '', 'Comment field found.');
$this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment/' . $anonymous_comment3->id());
......
......@@ -63,7 +63,7 @@ public function testBookCommentPrint() {
$this->assertText($comment_subject, 'Comment subject found');
$this->assertText($comment_body, 'Comment body found');
$this->assertText(t('Add new comment'), 'Comment form found');
$this->assertField('subject', 'Comment form subject found');
$this->assertField('subject[0][value]', 'Comment form subject found');
$this->drupalGet('book/export/html/' . $book_node->id());
......@@ -72,7 +72,7 @@ public function testBookCommentPrint() {
$this->assertText($comment_body, 'Comment body found');
$this->assertNoText(t('Add new comment'), 'Comment form not found');
$this->assertNoField('subject', 'Comment form subject not found');
$this->assertNoField('subject[0][value]', 'Comment form subject not found');
}
}
......@@ -105,7 +105,7 @@ function testCommentLanguage() {
$prefix = empty($prefixes[$langcode]) ? '' : $prefixes[$langcode] . '/';
$comment_values[$node_langcode][$langcode] = $this->randomName();
$edit = array(
'subject' => $this->randomName(),
'subject[0][value]' => $this->randomName(),
'comment_body[0][value]' => $comment_values[$node_langcode][$langcode],
);
$this->drupalPostForm($prefix . 'node/' . $node->id(), $edit, t('Preview'));
......
......@@ -96,18 +96,19 @@ function postComment(EntityInterface $entity, $comment, $subject = '', $contact
$instance = FieldInstanceConfig::loadByName('entity_test', 'entity_test', 'comment');
$preview_mode = $instance->getSetting('preview');
$subject_mode = $instance->getSetting('subject');
// Must get the page before we test for fields.
if ($entity !== NULL) {
$this->drupalGet('comment/reply/entity_test/' . $entity->id() . '/comment');
}
if ($subject_mode == TRUE) {
$edit['subject'] = $subject;
// Determine the visibility of subject form field.
if (entity_get_form_display('comment', 'comment', 'default')->getComponent('subject')) {
// Subject input allowed.
$edit['subject[0][value]'] = $subject;
}
else {
$this->assertNoFieldByName('subject', '', 'Subject field not found.');
$this->assertNoFieldByName('subject[0][value]', '', 'Subject field not found.');
}
if ($contact !== NULL && is_array($contact)) {
......@@ -303,7 +304,7 @@ function testCommentFunctionality() {
// Attempt to view test entity comment form while disallowed.
$this->drupalGet('comment/reply/entity_test/' . $this->entity->id() . '/comment');
$this->assertText('You are not authorized to post comments', 'Error attempting to post comment.');
$this->assertNoFieldByName('subject', '', 'Subject field not found.');
$this->assertNoFieldByName('subject[0][value]', '', 'Subject field not found.');
$this->assertNoFieldByName('comment_body[0][value]', '', 'Comment field not found.');
user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array(
......@@ -316,7 +317,7 @@ function testCommentFunctionality() {
$this->assertPattern('@<h2[^>]*>Comments</h2>@', 'Comments were displayed.');
$this->assertLink('Log in', 0, 'Link to log in was found.');
$this->assertLink('register', 0, 'Link to register was found.');
$this->assertNoFieldByName('subject', '', 'Subject field not found.');
$this->assertNoFieldByName('subject[0][value]', '', 'Subject field not found.');
$this->assertNoFieldByName('comment_body[0][value]', '', 'Comment field not found.');
// Test the combination of anonymous users being able to post, but not view
......@@ -330,7 +331,7 @@ function testCommentFunctionality() {
));
$this->drupalGet('entity_test/' . $this->entity->id());
$this->assertNoPattern('@<h2[^>]*>Comments</h2>@', 'Comments were not displayed.');
$this->assertFieldByName('subject', '', 'Subject field found.');
$this->assertFieldByName('subject[0][value]', '', 'Subject field found.');
$this->assertFieldByName('comment_body[0][value]', '', 'Comment field found.');
$this->drupalGet('comment/reply/entity_test/' . $this->entity->id() . '/comment/' . $comment1->id());
......@@ -411,7 +412,7 @@ function testCommentFunctionality() {
$this->assertNoField('edit-field-foobar-0-status-0');
$this->drupalGet('comment/reply/entity_test/comment/' . $new_entity->id());
$this->assertNoFieldByName('subject', '', 'Subject field found.');
$this->assertNoFieldByName('subject[0][value]', '', 'Subject field found.');
$this->assertNoFieldByName('comment_body[0][value]', '', 'Comment field found.');
}
......
......@@ -307,7 +307,6 @@ function testTwoPagers() {
$comments = array();
foreach (array('comment', 'comment_2') as $field_name) {
$this->setCommentForm(TRUE, $field_name);
$this->setCommentSubject(TRUE, $field_name);
$this->setCommentPreview(DRUPAL_OPTIONAL, $field_name);
$this->setCommentSettings('default_mode', CommentManagerInterface::COMMENT_MODE_FLAT, 'Comment paging changed.', $field_name);
......
......@@ -50,17 +50,17 @@ function testCommentPreview() {
// As the web user, fill in the comment form and preview the comment.
$edit = array();
$edit['subject'] = $this->randomName(8);
$edit['subject[0][value]'] = $this->randomName(8);
$edit['comment_body[0][value]'] = $this->randomName(16);
$this->drupalPostForm('node/' . $this->node->id(), $edit, t('Preview'));
// Check that the preview is displaying the title and body.
$this->assertTitle(t('Preview comment | Drupal'), 'Page title is "Preview comment".');
$this->assertText($edit['subject'], 'Subject displayed.');
$this->assertText($edit['subject[0][value]'], 'Subject displayed.');
$this->assertText($edit['comment_body[0][value]'], 'Comment displayed.');
// Check that the title and body fields are displayed with the correct values.
$this->assertFieldByName('subject', $edit['subject'], 'Subject field displayed.');
$this->assertFieldByName('subject[0][value]', $edit['subject[0][value]'], 'Subject field displayed.');
$this->assertFieldByName('comment_body[0][value]', $edit['comment_body[0][value]'], 'Comment field displayed.');
// Check that the signature is displaying with the correct text format.
......@@ -83,7 +83,7 @@ function testCommentEditPreviewSave() {
$edit = array();
$date = new DrupalDateTime('2008-03-02 17:23');
$edit['subject'] = $this->randomName(8);
$edit['subject[0][value]'] = $this->randomName(8);
$edit['comment_body[0][value]'] = $this->randomName(16);
$edit['name'] = $web_user->getUsername();
$edit['date[date]'] = $date->format('Y-m-d');
......@@ -92,18 +92,18 @@ function testCommentEditPreviewSave() {
$expected_text_date = format_date($raw_date);
$expected_form_date = $date->format('Y-m-d');
$expected_form_time = $date->format('H:i:s');
$comment = $this->postComment($this->node, $edit['subject'], $edit['comment_body[0][value]'], TRUE);
$comment = $this->postComment($this->node, $edit['subject[0][value]'], $edit['comment_body[0][value]'], TRUE);
$this->drupalPostForm('comment/' . $comment->id() . '/edit', $edit, t('Preview'));
// Check that the preview is displaying the subject, comment, author and date correctly.
$this->assertTitle(t('Preview comment | Drupal'), 'Page title is "Preview comment".');
$this->assertText($edit['subject'], 'Subject displayed.');
$this->assertText($edit['subject[0][value]'], 'Subject displayed.');
$this->assertText($edit['comment_body[0][value]'], 'Comment displayed.');
$this->assertText($edit['name'], 'Author displayed.');
$this->assertText($expected_text_date, 'Date displayed.');
// Check that the subject, comment, author and date fields are displayed with the correct values.
$this->assertFieldByName('subject', $edit['subject'], 'Subject field displayed.');
$this->assertFieldByName('subject[0][value]', $edit['subject[0][value]'], 'Subject field displayed.');
$this->assertFieldByName('comment_body[0][value]', $edit['comment_body[0][value]'], 'Comment field displayed.');
$this->assertFieldByName('name', $edit['name'], 'Author field displayed.');
$this->assertFieldByName('date[date]', $edit['date[date]'], 'Date field displayed.');
......@@ -115,7 +115,7 @@ function testCommentEditPreviewSave() {
// Check that the comment fields are correct after loading the saved comment.
$this->drupalGet('comment/' . $comment->id() . '/edit');
$this->assertFieldByName('subject', $edit['subject'], 'Subject field displayed.');
$this->assertFieldByName('subject[0][value]', $edit['subject[0][value]'], 'Subject field displayed.');
$this->assertFieldByName('comment_body[0][value]', $edit['comment_body[0][value]'], 'Comment field displayed.');
$this->assertFieldByName('name', $edit['name'], 'Author field displayed.');
$this->assertFieldByName('date[date]', $expected_form_date, 'Date field displayed.');
......@@ -123,7 +123,7 @@ function testCommentEditPreviewSave() {
// Submit the form using the displayed values.
$displayed = array();
$displayed['subject'] = (string) current($this->xpath("//input[@id='edit-subject']/@value"));
$displayed['subject[0][value]'] = (string) current($this->xpath("//input[@id='edit-subject-0-value']/@value"));
$displayed['comment_body[0][value]'] = (string) current($this->xpath("//textarea[@id='edit-comment-body-0-value']"));
$displayed['name'] = (string) current($this->xpath("//input[@id='edit-name']/@value"));
$displayed['date[date]'] = (string) current($this->xpath("//input[@id='edit-date-date']/@value"));
......@@ -134,7 +134,7 @@ function testCommentEditPreviewSave() {
$comment_storage = \Drupal::entityManager()->getStorage('comment');
$comment_storage->resetCache(array($comment->id()));
$comment_loaded = Comment::load($comment->id());
$this->assertEqual($comment_loaded->getSubject(), $edit['subject'], 'Subject loaded.');
$this->assertEqual($comment_loaded->getSubject(), $edit['subject[0][value]'], 'Subject loaded.');
$this->assertEqual($comment_loaded->comment_body->value, $edit['comment_body[0][value]'], 'Comment body loaded.');
$this->assertEqual($comment_loaded->getAuthorName(), $edit['name'], 'Name loaded.');
$this->assertEqual($comment_loaded->getCreatedTime(), $raw_date, 'Date loaded.');
......
......@@ -114,18 +114,19 @@ public function postComment($entity, $comment, $subject = '', $contact = NULL, $
$instance = FieldInstanceConfig::loadByName('node', 'article', $field_name);
}
$preview_mode = $instance->settings['preview'];
$subject_mode = $instance->settings['subject'];
// Must get the page before we test for fields.
if ($entity !== NULL) {
$this->drupalGet('comment/reply/node/' . $entity->id() . '/' . $field_name);
}
if ($subject_mode == TRUE) {
$edit['subject'] = $subject;
// Determine the visibility of subject form field.
if (entity_get_form_display('comment', 'comment', 'default')->getComponent('subject')) {
// Subject input allowed.
$edit['subject[0][value]'] = $subject;
}
else {
$this->assertNoFieldByName('subject', '', 'Subject field not found.');
$this->assertNoFieldByName('subject[0][value]', '', 'Subject field not found.');
}
if ($contact !== NULL && is_array($contact)) {
......@@ -211,12 +212,20 @@ function deleteComment(CommentInterface $comment) {
*
* @param bool $enabled
* Boolean specifying whether the subject field should be enabled.
* @param string $field_name
* (optional) Field name through which the comment should be posted.
* Defaults to 'comment'.
*/
public function setCommentSubject($enabled, $field_name = 'comment') {
$this->setCommentSettings('subject', ($enabled ? '1' : '0'), 'Comment subject ' . ($enabled ? 'enabled' : 'disabled') . '.', $field_name);
public function setCommentSubject($enabled) {
$form_display = entity_get_form_display('comment', 'comment', 'default');
if ($enabled) {
$form_display->setComponent('subject', array(
'type' => 'string',
));
}
else {
$form_display->removeComponent('subject');
}
$form_display->save();
// Display status message.
$this->pass('Comment subject ' . ($enabled ? 'enabled' : 'disabled') . '.');
}
/**
......
......@@ -106,7 +106,7 @@ protected function createEntity($values, $langcode, $comment_type = 'comment_art
protected function getNewEntityValues($langcode) {
// Comment subject is not translatable hence we use a fixed value.
return array(
'subject' => $this->subject,
'subject' => array(array('value' => $this->subject)),
'comment_body' => array(array('value' => $this->randomName(16))),
) + parent::getNewEntityValues($langcode);
}
......
......@@ -451,7 +451,7 @@ function testForumWithNewPost() {
$this->drupalLogin($this->post_comment_user);
// Post a reply to the topic.
$edit = array();
$edit['subject'] = $this->randomName();
$edit['subject[0][value]'] = $this->randomName();
$edit['comment_body[0][value]'] = $this->randomName();
$this->drupalPostForm('node/' . $node->id(), $edit, t('Save'));
$this->assertResponse(200);
......
......@@ -39,69 +39,31 @@ migrate.source.variable:
migrate.source.d6_comment:
type: migrate_source
label: 'Drupal 6 book'
label: 'Drupal 6 comment'
mapping:
constants:
type: mapping
label: 'Constants'
mapping:
field_id:
type: string
label: 'Field ID'
entity_type:
type: string
label: 'Entity type'
migrate.source.d6_comment_variable:
migrate.source.d6_comment_variable_per_comment_type:
type: migrate_source
label: 'Drupal 6 book'
label: 'Drupal 6 comment variable'
mapping:
constants:
type: mapping
type: migrate_entity_constant
label: 'Constants'
mapping:
entity_type:
type: string
label: 'Entity type'
field_name:
type: string
label: 'Entity type'
view_mode:
type: string
label: 'Entity type'
options:
type: sequence
label: 'Options'
sequence:
- type: string
label: 'Option'
type:
type: string
label: 'Type'
id:
type: string
label: 'ID'
name:
type: label
label: 'Name'
migrate.source.d6_comment:
migrate.source.d6_comment_entity_form_display_subject:
type: migrate_source
label: 'Drupal 6 comment'
label: 'Drupal 6 comment subject entity form display'
mapping:
constants:
type: mapping
type: migrate_entity_constant
label: 'Constants'
mapping:
field_name:
type: string
label: 'Field name'
comment_type:
type: string
label: 'Comment type'
entity_type:
type: string
label: 'Entity type'
migrate.source.d6_box:
type: migrate_source
......
......@@ -26,13 +26,12 @@ public function import(Row $row, array $old_destination_id_values = array()) {
}
$entity = $this->getEntity($values['entity_type'], $values['bundle'], $values[static::MODE_NAME]);
if (!$row->getDestinationProperty('hidden')) {
$entity
->setComponent($values['field_name'], $row->getDestinationProperty('options') ?: array())
->save();
$entity->setComponent($values['field_name'], $row->getDestinationProperty('options') ?: array());
}
else {
$entity->removeComponent($values['field_name']);
}
$entity->save();
return array_values($values);
}
......
......@@ -3,8 +3,6 @@ label: Drupal 6 comments
source:
plugin: d6_comment
constants:
field_name: comment
comment_type: comment
entity_type: node
process:
cid: cid
......@@ -20,8 +18,10 @@ process:
migration: d6_node
source: nid
entity_type: 'constants/entity_type'
field_name: 'constants/field_name'
comment_type: 'constants/comment_type'
# field_name & comment_type is calculated in
# \Drupal\migrate_drupal\Plugin\migrate\source\d6\Comment::prepareRow()
field_name: field_name
comment_type: comment_type
subject: subject
uid:
-
......
id: d6_comment_entity_form_display
label: Drupal 6 comment form display configuration
label: Drupal 6 comment field form display configuration
source:
plugin: d6_comment_variable
constants:
......
id: d6_comment_entity_form_display_subject
label: Drupal 6 comment subject form display configuration
source:
plugin: d6_comment_variable_per_comment_type
constants:
entity_type: comment
field_name: subject
form_mode: default
options:
type: string
weight: 10
process:
entity_type: 'constants/entity_type'
field_name: 'constants/field_name'
form_mode: 'constants/form_mode'
options: 'constants/options'
hidden:
plugin: static_map
source: comment_type
default_value: false
map:
comment_no_subject: true # Hide subject field
comment: false
bundle: comment_type
destination:
plugin: component_entity_form_display
migration_dependencies:
required:
- d6_comment_type
id: d6_comment_field
label: Drupal 6 comment field configuration
source:
plugin: d6_comment_variable
plugin: d6_comment_variable_per_comment_type
constants:
entity_type: node
type: comment
id: node.comment
name: comment
settings:
content_type: comment
process:
entity_type: 'constants/entity_type'
id: 'constants/id'
name: 'constants/name'
name: comment_type
type: 'constants/type'
settings: 'constants/settings'
'settings/comment_type': comment_type
destination:
plugin: entity:field_config
migration_dependencies:
required:
- d6_comment_type
......@@ -4,21 +4,24 @@ source:
plugin: d6_comment_variable
constants:
entity_type: node
field_name: comment
label: Comment settings
required: true
process:
entity_type: 'constants/entity_type'
field_name: 'constants/field_name'
label: 'constants/label'
required: 'constants/required'
field_name:
plugin: static_map
source: comment_subject_field
default_value: comment
map:
0: comment_no_subject
bundle: node_type
'default_value/0/status': comment
'settings/default_mode': comment_default_mode
'settings/per_page': comment_default_per_page
'settings/anonymous': comment_anonymous
'settings/subject': comment_subject_field
'settings/form_location': comment_form_location
'settings/preview': comment_preview
destination:
......
id: d6_comment_type
label: Drupal 6 comment type
source:
plugin: variable
variables:
# Ensure that we get at least one row to process by using variables that exist
# on every Drupal 6 site. We just need a single one of these, but include a
# few to be sure.
- site_name
- menu_expanded
- menu_masks
- css_js_query_string
- clean_url
plugin: d6_comment_variable_per_comment_type
constants:
entity_type: node
id: comment
label: comment
description: comment
process:
target_entity_type_id: 'constants/entity_type'
id: 'constants/id'
label: 'constants/label'
description: 'constants/description'
id: comment_type
label: label
description: description
destination:
plugin: entity:comment_type
......@@ -28,7 +28,9 @@ public function query() {
->fields('c', array('cid', 'pid', 'nid', 'uid', 'subject',
'comment', 'hostname', 'timestamp', 'status', 'thread', 'name',
'mail', 'homepage', 'format'));
$query->orderBy('timestamp');
$query->innerJoin('node', 'n', 'c.nid = n.nid');
$query->fields('n', array('type'));
$query->orderBy('c.timestamp');
return $query;
}
......@@ -36,6 +38,15 @@ public function query() {
* {@inheritdoc}
*/
public function prepareRow(Row $row, $keep = TRUE) {
if ($this->variableGet('comment_subject_field_' . $row->getSourceProperty('type'), 1)) {
// Comment subject visible.
$row->setSourceProperty('field_name', 'comment');
$row->setSourceProperty('comment_type', 'comment');
}
else {
$row->setSourceProperty('field_name', 'comment_no_subject');
$row->setSourceProperty('comment_type', 'comment_no_subject');
}
// In D6, status=0 means published, while in D8 means the opposite.
// See https://drupal.org/node/237636
$row->setSourceProperty('status', !$row->getSourceProperty('status'));
......
......@@ -59,6 +59,8 @@ protected function getCommentVariables() {
// just the node type in it.
foreach ($return as $node_type => $data) {
$return[$node_type]['node_type'] = $node_type;
$return[$node_type]['comment_type'] = empty($data['comment_subject_field']) ?
'comment_no_subject' : 'comment';
}
return $return;
}
......@@ -69,6 +71,7 @@ protected function getCommentVariables() {
public function fields() {
return $this->commentPrefixes() + array(
'node_type' => $this->t('The node type'),
'comment_type' => $this->t('The comment type'),
);
}
......
<?php
/**
* @file
* Contains \Drupal\migrate_drupal\Plugin\migrate\source\d6\CommentVariablePerCommentType.
*/
namespace Drupal\migrate_drupal\Plugin\migrate\source\d6;
/**
* @MigrateSource(
* id = "d6_comment_variable_per_comment_type"
* )
*/
class CommentVariablePerCommentType extends CommentVariable {
/**
* Retrieves the values of the comment variables grouped by comment type.
*
* @return array
*/
protected function getCommentVariables() {
$node_types = parent::getCommentVariables();
// The return key used to separate comment types with hidden subject field.
$return = array();
foreach ($node_types as $node_type => $data) {
// Only 2 comment types depending on subject field visibility.
if (empty($data['comment_subject_field'])) {
// Default label and description should be set in migration.
$return['comment'] = array(
'comment_type' => 'comment',
'label' => $this->t('Default comments'),
'description' => $this->t('Allows commenting on content')
);
}
else {
// Provide a special comment type with hidden subject field.
$return['comment_no_subject'] = array(
'comment_type' => 'comment_no_subject',
'label' => $this->t('Comments without subject field'),
'description' => $this->t('Allows commenting on content, comments without subject field')