Hello,

between Ajax Comment i use modul "Comment sort by created" for showing new comments in top. In comment-wrapper.tpl.php i moved the comment_form in top too (before comments).

Now i have the problem .... when i post new comment over ajax .... he will show in the end from existing comments - not at beginning.

When you have 11 comments and you write a new comment he will published at number 12 - not number 1 and the writer dont see the comment in top. Only when i reload the site new comment will be number 1.

Has anyone a tip or an idea how can i fix this problem?

Sorry for my bad english.

Regards Matthias

Comments

Anonymous’s picture

Hi Matthias

I have exactly the same problem. And i would be very happy for a solution!

would anyone advice?

drummondf’s picture

Subscribing - I tried commenting out the AJAX that scrolls to the bottom, and that helped a bit, but the issue now is that the comment is created at the bottom of the comments and doesn't move to the top until it is refreshed.

k.minkov’s picture

Since I have the exact same problem I created a patch to the latest dev version that adds an option in configuration to show comments on top.

k.minkov’s picture

k.minkov’s picture

This is the same patch but against the latest stable version 7.x-1.0-alpha2

k.minkov’s picture

This is a little improved version of the patch above(against latest stable version 7.x-1.0-alpha2).

muschpusch’s picture

Version: 7.x-1.0-alpha1 » 7.x-1.0-beta2
Status: Active » Needs work

Sorry i was kind of busy... Could you re-roll against current dev? Also the selectors changed since the old code didn't work well with the views integration

k.minkov’s picture

Status: Needs work » Needs review
StatusFileSize
new6.05 KB

Here is a patch against latest dev. I also added descending ordering of the comments when "Post on top" is selected.

formatC'vt’s picture

this descending ordering of the comments work fine with multi-page (paginated) comments? I think pagination may be broken when you alter only sql request.

k.minkov’s picture

No, there is no problem with pagination.

ConradFlashback’s picture

#8 is perfect.
I hope this will go to the next beta version.

ConradFlashback’s picture

No sorry, #8 has a big problem.
It orders at the top the comments for all content types, not only for content types set in the admin.

formatC'vt’s picture

i'm not sure about this anyway because this is a comment_goodness module functionality

ConradFlashback’s picture

StatusFileSize
new29.3 KB

I post a sample image...

I have only a content type "Tag" with Ajax Comments enabled.
I also set new "post on top" check.

I have the top position not only in "tag" content type but also in all content types comments (also in advanced forum posts, that's not good).

k.minkov’s picture

Yess, this is really serious issue. Here is a new version of the patch that fixes it.

ConradFlashback’s picture

k.minkov now is perfect!
Thanks!!

anonym-developer’s picture

still got an issue after #15:
if there are no comments yet, the first comment is been prepended to my form. any ideas?

formatC'vt’s picture

why do you don't want set comment place in site theme?

hydra’s picture

StatusFileSize
new768 bytes

This module is compatible with comment_goodness which will achive that.
However, if you are not interested in all the "goodness" there is https://www.drupal.org/project/comment_sort_created which will only do that.

With the attached patch ajax_comments will be compatible with the other module, too. I think this is much easier then the proposed approach.

formatC'vt’s picture

Status: Needs review » Needs work

thanks but, what about if you don't have comment_goodness and comment_sort_created? $sort = NULL, not 1?

hydra’s picture

Version: 7.x-1.0-beta2 » 7.x-1.x-dev
Status: Needs work » Needs review
StatusFileSize
new890 bytes

Oh yeah, thx for the review. Should be default then right? Updated the patch a bit to be a bit more robust.

  • formatC'vt committed 09f7a53 on 7.x-1.x authored by Hydra
    Issue #2098849 by Hydra, formatC'vt: Add comment_sort_created module...
formatC'vt’s picture

Status: Needs review » Needs work

committed with some fixes but this issue still needs work i think.

formatC'vt’s picture

Status: Needs work » Fixed

Latest release has compatibility with Comment sort by created module

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.