Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
e.g. http://fullfact.org/find/health
I assume this would be the same for node types where comments are disabled when comment.module is enabled.
Using, Solr 3.5, Drupal 7.14
Comment | File | Size | Author |
---|---|---|---|
#8 | 1612530-8.patch | 4.17 KB | Nick_vh |
#7 | 1612530-7.patch | 1.74 KB | Nick_vh |
#6 | 1612530-6.patch | 880 bytes | Nick_vh |
#5 | 0comments-1612530-4.patch | 953 bytes | willmoy |
Comments
Comment #1
Nick_vhThis is the bad code!
Is there a way to easily see if a node can have comments or not?
Comment #2
Nick_vhComment #3
willmoy CreditAttribution: willmoy commentedThanks for the quick response!
From node_schema:
That becomes $node->comment
So if $node->comment == 0;
a comment count shouldn't be displayed.
I suggest also that if $node->comment == 1 and there are no comments, it shouldn't be displayed (because probably comments have always been turned off and displaying 0 comments in that case would be unhelpful).
Comment #4
Nick_vhMarking as feature request, not critical for now. Hopefully someone can provide us with a patch
Comment #5
willmoy CreditAttribution: willmoy commentedWell, I can provide a patch (which I think is trival). I've attached it. The problem is I can't test it because we don't run dev, the test suite won't run on the version we have installed, and I don't have a test installation. But here it is for what it's worth!
I defer to you, but I think it is a bug to say something has 0 comments when comments aren't even enable on the site (even if not a very important one) — but the way the markup is you can't hide just the comments bit with CSS.
Comment #6
Nick_vhThis looks a little cleaner to me. Can you confirm this works for you?
Comment #7
Nick_vhSeems like there was more crap in that function
Comment #8
Nick_vhComment #9
Nick_vhCommitted to D7, needs backport for D6.
Thanks for raising this issue
Comment #10
Nick_vhCommitted to 6.x-3.x. Thanks!
Comment #11
Nick_vhComment #11.0
swentel CreditAttribution: swentel commentedAdding version info