Currently, Drupal allows you to change the default display order of comments in comment settings between "most recent last" and "most recent first".
The only site I've ever seen use "most recent first" was groups.drupal.org a while ago, combined with threading.
This meant when you read discussions, your eye would have to travel like / \ / \ / \ between the various threads, as opposed to the standard \ \ \ \ with "most recent last" threading, or | with a flat list. Moshe changed the setting back to "most recent last" when some of us mentioned it in IRC, and it's been much better since then.
Therefore, I'm proposing this be removed from core as a significant usability bug. By the time D7 is released, I'm sure it'll be quite possible to override comment ordering in views (in fact it might even be possible now), so there'll be a contrib option for people who really, really want this if they absolutely have to have it.
Comment | File | Size | Author |
---|---|---|---|
#32 | comments-threaded-settings.jpg | 46.26 KB | paranojik |
#32 | comments-flat-settings.jpg | 61.08 KB | paranojik |
#22 | bring-back-comment-ordering-191499-22.patch | 5.54 KB | paranojik |
#21 | bring-back-comment-ordering-191499-21.patch | 4.03 KB | paranojik |
#14 | comment-ordering-test.patch | 11.93 KB | Damien Tournoud |
Comments
Comment #1
dwwI'd be in favor of always making comments oldest first and removing the option (and underlying code complexity) entirely. Top posting is evil. At the *very* least it should default to oldest first, not top-posting. :(
However, I'm sure some "but Drupal should let me be flexible and decide I want to eat puppies" do-gooder will come along and complain that we're being tyrants by "restricting choices"... :(
But, to the extent my biased opinions count for anything, I'd be fully in support of this restriction/simplification.
A: Yes.
Q: Are you sure?
A: Because it's confusing.
Q: Why don't you like top-posting?
-Derek
Comment #2
catchBump.
One situation you might want comments top-posted for, is if you do a guestbook/myspace style thing on user profiles with comments - where it's not actually a discussion but a stream of random stuff. Notwithstanding views covering this, I think we could at least reduce the options like this:
Flat - most recent first or last
Threaded - most recent last.
That'd get rid of the worst offender - reverse order threaded comments, which is pretty much impossible to follow (cf. groups a year or more ago).
Comment #3
Dries CreditAttribution: Dries commentedYes, please.
Comment #4
erofadd CreditAttribution: erofadd commentedYes I this can be done by using the views module through the Sort Category
If its a new commnent you want to create you can simply click on the add button to add a new comment view which can be edited using the sort category order in views.
all the best.
Comment #5
catchOK so looks like this is a goer.
There's some UI, and probably storage issues with this.
Currently we have these options:
Default display mode:
- Flat list - collapsed
- Flat list - expanded
- Threaded list - collapsed
- Threaded list - expanded
Default display order:
- Date - newest first
- Date - oldest first
(note that both 'default display' can't be overridden any more, because comment controls is gone - this means the help next needs fixing - another issue though).
I think it'd be nice to take the opportunity to rationalise these options a bit - to something like:
Appearance:
- Expanded
- Collapsed
Display mode:
- Flat list
- Threaded
(bit of conditional show/hide javascript)
Display order:
- Newest first
- Oldest first
This gives the user 2/3 choices to make, between 2 options a time, instead of two choices between up to four options. Hopefully a bit easier to grok. Will need to look in more detail how this would affect the variables though.
Comment #6
xmacinfoI definitely would like to keep the display order option site wide default. When doing intranets, I love showing the most recent comments at the top.
However, the whole comments display should, IMHO, look like Nabble. They are threaded and they are all collapsed. We could have button to uncollapse all comments, etc.
Comments settings could then be used to set:
- Newest/Oldest first
- Collapsed/Expanded view
Would we need to set Flat/Threaded only if comments are threaded like Nabble and collapsible individually?
Just my two cents.
Comment #7
eaton CreditAttribution: eaton commentedViews 2 lets you create Views of comments. I'm all in favor of making Earl the solution to all our special-cases. ;-)
Comment #8
catchHere's a patch.
Removes everything to do with display order 'newest first', deletes the variable for the node types, fixes a bug in comment.test where it was setting a variable incorrectly (comment_default_per_page vs. comment_default_per_page_article).
All comment tests pass with this patch.
Comment #9
catchImproved a couple of comments and added CHANGELOG.txt entry.
Comment #10
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #11
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #12
xmacinfoI still think this is a regression. And forcing users to load Views is not a good choice at all.
Unless we plan to move views in the core, we should roll back this code.
Comment #13
Damien Tournoud CreditAttribution: Damien Tournoud commentedAfter a discussion with catch, chx and webchick on IRC, we came to the conclusion that we should better keep the underlying code for this ordering, and just remove the UI elements in the administration page.
So here is a patch that partially revert what was committed previously, only adapted to DB:TNG. I'm working on the test on that whole "comment ordering" functionality.
The only chunk that requires an explanation is this one:
The LIMIT is *intended* to be in the internal subquery, but our query builder currently does not support this. I also fixed the query for the other ordering, that was wrongly converted (see #314349). We also need a test for this.
Also, the ordering now default to oldest first, as per comments in that issue.
Comment #14
Damien Tournoud CreditAttribution: Damien Tournoud commentedHere is a test for the comment ordering feature, and also cleaned-up comment.test to comply with Test writers' guidelines.
Comment #15
keith.smith CreditAttribution: keith.smith commentedComment #17
tsi CreditAttribution: tsi commented+1 for bringing back the underlying code (without UI), and subscribe.
Comment #18
BarisW CreditAttribution: BarisW commentedTried the patch in #13 but got some errors. Only chunk 1 and 2 could be applied correctly. I'm using Drupal 7.0.
Comment #19
xmacinfoThat patch is way too old. You'd need to reroll it.
Comment #20
BarisW CreditAttribution: BarisW commentedAh, apologies. Didn't see that the patch was from 2008 :p
I now just copied the comment module to my sites/all/modules folder and changed the ASC to DESC in the code to get it working. Dirty, but works for this small website. Tried views, but failed (AJAX error).
Comment #21
paranojik CreditAttribution: paranojik commentedI rerolled the patch from #13, but stripped away ordering for threaded comments.
Users should manually set the variable: variable_set('comment_default_order_' . $node->type, COMMENT_ORDER_NEWEST_FIRST), otherwise the default behaviour is COMMENT_ORDER_OLDEST_FIRST.
Comment #22
paranojik CreditAttribution: paranojik commentedHere's a version with a UI for selecting the display order.
Comment #24
paranojik CreditAttribution: paranojik commented#22: bring-back-comment-ordering-191499-22.patch queued for re-testing.
Comment #25
slashrsm CreditAttribution: slashrsm commentedCode looks good. I think, that we should preserve a way to sort comments. Since custom sorting is probbably not used when using threaded view, it can be really usefull when using flat view.
I think we should leave just this functionality without UI. One, that needs it, can set this variable.
Comment #26
catchNeeds to go into 8.x first.
Comment #27
Dries CreditAttribution: Dries commentedIt is not really explained why we want to keep this and roll back part of the original patch.
Personally, I do think it is a good idea to remove it and to get closer to Views. It makes sense to have some sort of query builder in core at some point.
If we want to keep this, we should discuss about it some more. I'm not sure we have a convincing case for it.
Comment #28
gavri CreditAttribution: gavri commentedHere is a quick fix for D7 on the theme level using hook_page_alter
(change bartik with the hook name - (the name of the theme on the module)
Comment #29
paranojik CreditAttribution: paranojik commented@#28: I don't think this will work for discussions that spread over multiple pages.
@#27: Some points have already been made earlier in this discussion. In my opinion the decision to strip out the ordering code was done without thinking twice (as you can see from comments #6 to #10).
I think using views for such a little tweak is quite an overhead (from the amount of time one has to spend to implement this tweak, or from the performance viewpoint).
This patch brings very little code (so maintaining it shouldn't be a problem) but solves one (from my experience) not so rare use-case. The current solution in core looks like it's "half done". I'm for the inclusion of both the ordering code and the UI. We need this because it's always been there and we are used to it. We use it. It's quick and simple. It's intuitive.
Comment #30
catchAren't these queries alterable? If so a contrib module could provide a ui for this and handle the ordering too, no need for views. If they're not alterable that's and easy change to make. For the record this was not removed 'without a second thought', was posted following usability testing if d6 in Minnesota where we saw someone click on the comment settings fieldset, drop their jaw at the metre length list of options that had just been exposed, and then 'yowzer'. Not to mention several sites including groups.drupal.org at one point would manage to combine both threading and newest first ordering, which was completely unreadable at least without heavy theming. If this can't be done from contrib via hook_query_alter() let's fix that, but otherwise I'm opposed to adding this back.
Comment #31
xmacinfoThe idea is to add back the settings for the site admins only, not for the end users on the comment form. :-)
Comment #32
paranojik CreditAttribution: paranojik commentedMaybe I should have been clearer. I'm attaching two screenshots of the node-type edit form showing only the comment settings section. This patch only applies to this form. The "Display order" dropdown is only visible for flat comments and is shown/hidden with js.
Comment #33
catch@xmacinfo: it was the admin settings I was talking about.
Comment #34
slashrsm CreditAttribution: slashrsm commentedI also think that we should keep some way to *easyly* change comments ordering. UI part of this functionality can be removed, but variable should stay there IMO.
We should consistently tag all queries that relate to comment list, if we decide that this must be done via hook_query_alter().
Comment #35
acouch CreditAttribution: acouch commentedThis is a vote for re-adding the content ordering along with the UI. As the screenshot at #32 shows it doesn't (in my opinion) add too much more to the node edit form.
I am not a fan of showing most recent comments first but have seen that cropping up more and more in successful sites (example: http://host.madison.com/ct/business/biz_beat/article_dd6fdfc2-7685-11e0-...) and think it would be better to have the option.
Comment #36
dddbbb CreditAttribution: dddbbb commentedsub
Comment #37
realguess CreditAttribution: realguess commentedsub
Comment #38
Tuscan CreditAttribution: Tuscan commentedI hope this feature will be re-added, atleast for flat comments only. I am trying to build a simpler version of a Facebook wall/youtube style comments page using flat comments (meaning I need newest comments first!), I was quite surprised to find such a simple but useful feature removed in D7.. Google the subject and you will find that there are quite a few other frustrated developers out there too, i'd say that's reason to add it back..
Comment #39
dddbbb CreditAttribution: dddbbb commentedI've resorted to using Views/Panels to get newest comments first - only seems to work for flat comment though. Please bring this feature back!
Comment #40
FrequenceBanane CreditAttribution: FrequenceBanane commentedfuture backport interest me, so subscribe
Comment #41
corbacho CreditAttribution: corbacho commentedFact:
Ok, blogger and wordpress don't have this option by default. But is Drupal only a blog platform? Comments can represent many different data when considering Drupal as a *framework*.
I agree that the ugly problem was when combined with threaded comments. So we can remove that: #32 screenshots looks very clean admin UI to me.
Also there are already issues in the forum: How to reverse comments order in Drupal 7? Simple task impossible? And someone has create a sandbox project to provide this feature Sort Comments
Really we want a new module? when it's only 1 extra variable that could be provided from core.
Please, reconsider to get it back.
Comment #42
xmacinfogroups.drupal.org have newest comments first as well. :-)
Comment #43
dddbbb CreditAttribution: dddbbb commentedOther site examples aside, I still think a choice between newset or oldest first is better than it being forced either way.
Comment #44
xmacinfo#22: bring-back-comment-ordering-191499-22.patch queued for re-testing.
Comment #45
Tuscan CreditAttribution: Tuscan commentedWas a bit silly to remove the option in the first place imo
Comment #46
xmacinfoComment #47
dixon_I think the decision to remove this was based on very good usability studies as catch mentions in #30. I also think it's quite clear that reverse ordering of comments is relatively rare on most sites. Those two arguments makes this a perfect case for contrib to solve.
But before closing this as a "won't fix", it would be interesting to hear the arguments behind the mentioned discussion in #13 (although it was a very long time ago).
Comment #48
xmacinfoI would consider LinkedIn, Google+ and Facebook as very good examples to follow.
Comment #49
paranojik CreditAttribution: paranojik commentedAs @slashrsm already said in #34: at least what we should do is consistently tag all comment sort related queries. Until then contrib can only provide ugly hacks.
Comment #50
Bojhan CreditAttribution: Bojhan commented@xmacinfo Actually, that is entirely untrue - those are all "activity stream" which this is not.
Comment #51
dddbbb CreditAttribution: dddbbb commentedClearly there are conflicting opinions. Surely it makes sense to provide an option for the site owner to decide which order their comments appear in?
Comment #52
slashrsm CreditAttribution: slashrsm commentedI agree with dixhuit. I understand, that there was a usability problem with this feature, but none of us requests that form element to be re-added. We just request some mechanism to override default behaviour on a non-hackish way.
I see two solutions, that do that and leave UI as it is:
- add consistent tag to all comment query, so we can override them in contrib or
- add variable that stores sort configuration (as it was in D6), which can be changed with drush or in a contrib module.
Both solutions fix this problem and leave UI as it is now.
Comment #53
corbacho CreditAttribution: corbacho commented@slashrsm See #41 , there is already a contrib module that changes the variable.
Comment #55
laura s CreditAttribution: laura s commentedI'm kind of flabbergasted that this configuration was removed. I don't know of any broadly accepted "best practice" of allowing only display of comments in chronological order. I would think the UX preferred by the site owner for the end user is more important than the UX of n00b site admins confused by too many form items. How many people are looking at the comments on a daily basis, vs. how many people are configuring commenting sorting order on a daily basis? Which should get the prioritized treatment?
BTW the module in #41 has 1 bug, with 2 people reporting that the module does not work. #1315324: Panels module integration
Comment #56
enzipher CreditAttribution: enzipher commented+1 for bringing back the sorting. I was kinda chocked that a simple basic setting like this had been removed. To be forced to install yet another module for this is close to ridiculous.
As for the screenshot in #32, it doesn't have to be a select list, it can be a simple checkbox for "Show newest comments first". At least that would make it less cluttered.
Cheers,
Comment #57
Alex UA CreditAttribution: Alex UA commentedI'm with #55 and am equally flabbergasted that this very useful feature was removed. Please bring back this option, at least on the comment admin page (meaning at least let us set it globally for our preferred sort).
Comment #58
David_Rothstein CreditAttribution: David_Rothstein commentedMarked #1193520: Ability to sort threaded comments DESC (Newest First) as a duplicate.
This feature is now provided by at least two different D7 contrib modules:
http://drupal.org/project/sort_comments
http://drupal.org/project/comment_goodness
Surely it's useful in some cases, but how many? Frankly, newest first + flat seems to mainly be useful for sites that expect a high volume of low quality comments :) Newest first + threaded can in theory be more useful, but the way Drupal does it currently (where the spun-off threads get sorted newest first also) seems to make little sense. Overall, this feature tends to result in situations like @dww's example from #1...
I'm not sure why we need to go back to supporting this in core if it's possible in contrib. There are a lot of other very reasonable ways people might want to sort their comments (e.g. most-popular first, like StackExchange) but we can't deal with all the various cases in core anyway. I think it makes the most sense to just provide the basic ones and keep the UI simple.
Comment #59
brycesenz CreditAttribution: brycesenz commented@David_Rothstein -
"Surely it's useful in some cases, but how many?" You could use that logic to justify removing forums, contact forms, blogs, and probably about 2/3 of the rest of the modules that ship with core. And if you did, surely other contrib modules would step up to replace them in the following months.
If there are fundamental code/structure changes that warrant removing the code, then that's one thing. But it sounds like "recent comments first" just lost a popularity contest, and in the process screwed all of us who relied on that feature (and now can choose from two contrib modules, neither of which is stable).
#32 is one of many examples of how this could be added without causing a UX calamity.
Comment #60
laura s CreditAttribution: laura s commented@David_Rothstein I would be fine with having this functionality in contrib, but that would make most sense when comments functionality is also in contrib. At the moment, *neither* exists in contrib, and a host of Drupal projects require custom development to implement such a simple feature that is integral to comments configuration. Breaking off a piece of core comments functionality seems to be neither a UX improvement nor a step towards a streamlined core. It's just diminishment of functionality to achieve ... I still don't understand what.
Comment #61
corbacho CreditAttribution: corbacho commentedAs I said in #41, many sites use the "newest first", like Youtube.
Today I saw in Drupal Planet this (about new features of Drupal Garden):
So I think this is another prove that this setting IS useful. We were not crazy :)
I recommend you guys to have a look to Comment goodness: the module that is making possible for Drupal Gardens to offer this feature.
So, from my part I will not ask anymore to support this in core. It has more sense in the contrib.
And thanks to Acquia Engineers involved to contribute this module back.
Comment #65
P3t3r CreditAttribution: P3t3r commentedBoth comment goodness and sort comments reintroduce the underlying problem why it was removed in the first place. Does anyone know a mod that sorts the comments like facebook and other large sites, i.e. DESC on the initial comments, and then ASC to keep the trees readable? Like this:
2
2.1
2.1.1
2.1.2
2.2
1
1.1
1.2
1.2.1
1.2.2
Comment #66
acouch CreditAttribution: acouch commentedComment Bonus API supports the DESC for the replies for the initial comments. It is still under development which has gotten stalled a little on my end but would be helped by any enthusiasm that is out there.
Comment #67
P3t3r CreditAttribution: P3t3r commentedWow, that was well-hidden! I'll try it out asap, thx!
Comment #68
kscheirerI'm a little lost, I don't see a patch to review except way back in #22, and there's been lots of developments since then. Can someone summarize the current issue? I'm removing the backport tag until it's clear that something will be ported.
Comment #69
jonathanshawComment #73
jonathanshawWe need some comment here to explain the effect and motivation of Dries' commit.
Comment #83
xmacinfoWhat's happening with this issue and multiple commits?
Comment #84
dww@xmacinfo re: #83:
@xjm just populated the 9.1.x branch of core and pushed all those commits to Gitlab. That resulted in d.o thinking there were new commits and putting these comments on many (but not all) issues that are still open. It's weird that we saw #82 for 9.1.x, but didn't see anything like it for the 8.[5-9].x branches nor 9.0.x. This whole behavior is kinda weird. I don't know much about that plumbing anymore and the details of how/why it works the way it does. But that's what happened. /shrug
Comment #86
pameeela CreditAttribution: pameeela commentedThis issue is extremely confusing. The original issue was to remove the setting, and it was removed, but then it was re-opened to add it back but only the title was updated and not the issue summary. This may have made sense initially as part of a rollback strategy, but it's safe to say rolling back is no longer a viable option.
I think that after 13 years the (intentional) loss of this functionality no longer qualifies as a bug. It's also not really possible to see how it used to work.
To avoid further confusion I've updated the issue title to set it back to what it was originally. I also considered creating a feature request for it but there hasn't been a comment in support of this in 9 years. But if anyone feels like this should be a feature request, please create one with information about how it should work.