Comment indentation fails to close div tags if

(a) indentation depth > 2 and
(b) indentation depth decrements more than one level at once.

CommentFileSizeAuthor
#5 patch_72.txt991 byteswebernet
#3 patch_71.txt796 byteswebernet
fix-indentation.patch.txt801 bytesleflo
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

leflo’s picture

Version: 5.0-beta1 » 5.x-dev
webernet’s picture

Status: Needs review » Needs work

There does appear to be a vaild bug here. Adjacent comments in the nested list only differ by one level.

Unfortunately patch doesn't apply.

webernet’s picture

Title: Indentation fails » Threaded comment indentation broken
Status: Needs work » Needs review
FileSize
796 bytes

Currently, if a comment is indented, the next comment in the threaded list appears to be at most 1 level higher, even if it should be a top-level comment.

Currently it looks like this:
Comment 1
-Comment 1.1
--Comment 1.1.1
--Comment 1.1.2
-Comment 2

Should be:
Comment 1
-Comment 1.1
--Comment 1.1.1
--Comment 1.1.2
Comment 2

Patch seems to fix the issue, not sure if it's the right/best approach though.

merlinofchaos’s picture

I think this patch looks good. I was thinking that isnce the while loop decrements $last_depth setting it immediately after is unnecessary, but that while loop does not always run and the last_depth needs to be set. It may be that the $last_depth = $comment->depth should be moved to just before the else.

webernet’s picture

FileSize
991 bytes

Here's a revised patch.

Steven’s picture

Committed to HEAD, thanks.

webernet’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)