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.
I'm a relative newbie to Drupal. I'm not actively running a site on it, but I downloaded the 5.0-beta1 to check it out.
I set my Default display mode for Comments to: Flat list - expanded. But when I added some comment replies to a story, they still have the indented "outline" look.
Smells like a bug to me, but it's also possible that I don't know what I'm doing. :)
Comment | File | Size | Author |
---|---|---|---|
#3 | patch_78.txt | 1.3 KB | webernet |
#2 | comment.module_63.patch | 888 bytes | jclifton |
Comments
Comment #1
jclifton CreditAttribution: jclifton commentedstevenf,
The problem appears to be that the code in comment.module doesn't check to see if the comment mode is flat before wrapping the comment in a DIV tag that gets formatted as indented. If you replace the code in the module in lines 901-908 with the following, that will fix the problem:
Comment #2
jclifton CreditAttribution: jclifton commentedHere's a patch that fixes the problem.
Comment #3
webernet CreditAttribution: webernet commentedPatch changes it so the indentation divs are only added for threaded modes.
Comment #4
webernet CreditAttribution: webernet commentedBumping to critical since this needs to be fixed for RC1.
Comment #5
merlinofchaos CreditAttribution: merlinofchaos commentedShouldn't the depth remain static if we're not threaded? Meaning those divs should never be applied?
That might simply mean that our *starting* $last_depth is wrong, and assigning $last_depth = 1 could also fix it. Anyone got a testbed that can quickly check me on this?
Comment #6
merlinofchaos CreditAttribution: merlinofchaos commentedAllow me to clarify, because apparently I don't make sense today.
In this code, a div is only added if ($comment->depth != $last_depth).
That test should only be true if comments are threaded.
Therefore we should not need to test explicitly as to whether or not comments are threaded. Instead, I believe this means that have $last_depth set incorrectly, which not only means that flat comments are indented, but all comments are indented one extra level whether or not they are threaded.
Comment #7
merlinofchaos CreditAttribution: merlinofchaos commentedAlso, apparently I am completely wrong about this. In which case webernet's patch looks good.
Comment #8
ChrisKennedy CreditAttribution: ChrisKennedy commentedTested and works fine.
Comment #9
FiNeX CreditAttribution: FiNeX commentedThe patch works right!
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedtested and works good for me.
Comment #11
Steven CreditAttribution: Steven commentedTested and verified. Committed to HEAD. Thanks.
Comment #12
(not verified) CreditAttribution: commented