If you hide the subject widget on the comment form, or if the user does not enter a comment subject, a subject is auto-generated from the first sentence of your comment as the title. In Bartik this is displayed above the comment, which is redundant visual clutter.

Example:
--------

Hello this is a ....
Hello this is a comment!

Original report:
Only display for title comment i can hide, but for me not need title on comment form. field title i can not delete or hide.

Comments

Berdir’s picture

Status: Active » Fixed

You can hide the filed in the content type settings, in the "Comment settings" vertical tab, uncheck the "Allow comment title" checkbox.

aspilicious’s picture

Status: Fixed » Active

Berder I ran into the same issue he has *I think*.

If you don't allow the comment title, you can't choose a title, but in Bartik when your comment is saved it takes the first sentence of your comment as the title. Very ugly. I edited Bartik so it wouldn't show the title.

Example:
--------

Hello this is a

Hello this is a comment!

jcisio’s picture

Version: 7.0 » 8.x-dev
Category: bug » feature

I think this should be a feature request. When the title is empty, don't create a default title.

What I do in D6 and D7 is the following:
- Use hook_form_alter() to add a array_unshift($form['#submit'], 'mymodule_modify_comment');
- In mymodule_modify_comment(), check if $form_state['values']['subject'] is empty then replace it with a special string, like '(empty title)'
- Use hook_comment (hook_comment_view) to replace this special string to an empty string

Drupal is so powerful and flexible, but I think we need a simple option that doesn't create a default title when empty :-) Or should I make this a contrib module?

aspilicious’s picture

Status: Active » Closed (works as designed)

We can close this by design than...

jcisio’s picture

Title: Comment title can not be disable. » Option to not create a default title when empty
Status: Closed (works as designed) » Active
jhedstrom’s picture

Version: 8.0.x-dev » 8.1.x-dev
Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)
Issue tags: +Needs issue summary update

Been a while since this was updated. Anything left to be done?

jonathanshaw’s picture

Berdir's #1 no longer applies in D8, but #2227503: Apply formatters and widgets to Comment base fields would make the visibility of the subject configurable in D8.1.

Showing/hiding the subject depending on whether it was auto-generated or not seems like a specialised use case that should be handled in contrib (or by Rules etc.), doesn't need to be in core. Especially given the drive to focus the core comments module on providing an API framework not a solution to every possible site need.

The residual issue that is appropriate for core is that the out-of-the-box appearance is ugly because the subject field (although configurable) is visible by default. I propose the solution to this is for the subject to be hidden by default on the default display mode of the default comment type

Forums have their own comment type so I suggest are out-of-scope for this issue.

(#2312329: Hide the comment "subject" field by default on this subject had converged to be a duplicate of #2227503: Apply formatters and widgets to Comment base fields, so I closed it as a duplicate, and suggest discussing the question of what should be default in this issue instead).

jonathanshaw’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update
jonathanshaw’s picture

Title: Option to not create a default title when empty » Title should not be displayed when auto-generated from comment body
jonathanshaw’s picture

Status: Postponed (maintainer needs more info) » Active

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.