Problem/Motivation
- 99% of the world's commenting systems don't have a "subject" field, but Drupal does.
- Googling "drupal remove comment subject field" yields ~100,000 search results, which demonstrates how many people are annoyed by this and want to remove it.
- Almost always, the "subject" field ends up being automatically generated from the first ten or so words in the actual comment. Which makes it even less valuable. Look at any groups.drupal.org post. The first one I found was https://groups.drupal.org/node/432143. Look at the comment subjects. There's more harm than value in them. More noise than signal.
However, there are strong reasons for comment's continuing to have subject as a base field. For example, Drupal does not like entities that have no label, and having it as a base field makes it much easier for people who want it to enable it.
In D8.0 the subject field can be managed from "Manage form display", and is enabled by default on the default comment type. It cannot be managed from "Manage display" . There is a separate comment type used by the forum content type.
Proposed resolution
Let the subject field's visibility be configurable from "Manage display". Have it hidden by default on both form and display for the default comment type.
Remaining tasks
- Reach consensus on whether it should be visible by default on display and form for the default comment type.
- Create a new patch, replacing previous patches, to make the subject field configurable from "Manage display"
- Make sure that preprocess/template respects that setting then, since subject is hardcoded there.
API changes
None.
Comments
Comment #1
xjmMost forums I've used have post titles == our comment subject fields. What's always been annoying about Drupal's is that they don't automatically default to "Re: Title of post you're replying to", because of some unilateral opinion about emails Dries issued like a decade ago. :P It's the title == post first 10 words behavior that I think is the WTF.
That said, I'm not entirely opposed to this issue now that comments are fieldable.
Comment #2
wim leersExactly, thanks to comments being fieldable, folks can add back a "Subject" field (and add other things, like comment ratings).
BTW, can you give an example of forum software that use titles for replies? The only one I know is phpBB (which indeed uses "RE:
"). AFAICT vBulletin, Invision Powerboard, PunBB and generally comments (Disqus, Facebook Comments, WordPress…) don't have subjects/titles.
Comment #3
lewisnymanI think there can be different expectation between forum comments and article comments, but considering our default implementation out of the box, and arguably our majority user case in modern websites, we should favour the design pattern Wim mentions (Disqus, Facebook Comments, WordPress…).
This seems like a positive step change. If we think that the forum comments require the field then I guess we should be using a different bundle(?)
Comment #4
gábor hojtsy#2292821: Use widget for comment subject field made this easily configurable via the form display, no?!
Comment #5
tim.plunkettComment #6
larowlanNo objections here
Comment #7
wim leersGábor is right in #4. Removing the "subject" base field has huge consequences. Most notably: it makes it harder for those sites who want to use the Subject field. So I propose to simply not have a widget for the comment subject by default, and not output it by default.
This patch works fine, but should cause a whole bunch of test failures. Please give it a try.
Comment #8
wim leersComment #10
Bojhan commentedIt looks good to me. I don't think having titles on comments is a very current need, perhaps many years ago - but I can't really think of any reason why we should still have it by default.
Comment #11
andypostI think removal
suppose it's enough to remove last line.
nice but forum comment field needs tuning
Comment #12
fotuzlab commentedComment #13
fotuzlab commentedRunning little busy. Working on writing the tests. Would submit a patch by this weekend most probably.
Comment #14
wim leersThank you very much for working on this!
Comment #15
sharique commentedHow about deleted subject from entity instead of hiding it? Perhaps too big change for beta stage.
Comment #16
sharique commentedHere is updated patch.
Creating interdiff gives error
, so not able to create it.
Comment #17
andypostNot sure that () is needed, now tests
Comment #19
jonathanshawUnassigning as no activity for 10 months.
Comment #20
jonathanshawRather than stripping the subject out of the template, would it be better to add it in (hidden by default) as an item in the "manage display"? This makes it much easier for those who want it to enable it.
Different default behaviour between forums and other content types could be handled by having 2 default comment types in core: "Default comments" and "Forum replies". This seems more transparent and configurable than hardcoding that logic in the template.
Comment #21
berdirYes, to be able to bring this into 8.1, we need a way that is fully backwards compatible, not just API but also for existing templates and configuration. Unless they change something by hand, it must continue to work as before for them.
Agreed on the configurable suggestion, lets just keep the line about form and add the same for view. We just need to make sure that preprocess/template respects that setting then, since subject is hardcoded there.
To simplify this issue, it might be better to keep it in enabled by default in 8.x. Keep in mind that there are still places that show the comment subject, e.g. the comment administration, we can't remove it completely, likely not even in 9.x, since Drupal doesn't like entity types without a label very much (e.g. entity reference).
That also avoids the forum problem for now. I don't think we need a special case for that here. Keep in mind that the initial post in a forum is a *node*, not a comment. I do agree that forum comments should be a separate comment type, that would be a great example of comment types and be more flexible, but that might not be possible for 8.x and would complicate this issue a lot. An approach that's more likely to be possible in 8.x might be to add support for a configurable view mode to comment formatters and just have a different view mode for forum comments.
Comment #22
andypostForum already shipped with
/core/modules/forum/config/install/comment.type.comment_forum.ymlComment #23
jonathanshawNot enabling by default may be the simplest solution to #1018242: Title should not be displayed when auto-generated from comment body.
Therefore if we keep it enabled by default, we are left with an ugly cluttered out-of-the-box experience.
Comment #24
jonathanshawComment #25
jonathanshaw#2227503: Apply formatters and widgets to Comment base fields has already proceeded a long way with configurable visibility for the subject field, which is the best solution for the original problem behind the present issue.
Therefore I propose:
1) closing this issue as duplicate of #2227503: Apply formatters and widgets to Comment base fields
2) moving discussion as to whether it should be hidden by default to #1018242: Title should not be displayed when auto-generated from comment body as that issue is now the main motivation to hide by default.