Hi guys, great module... had a flawless install and the module is running very well!

The comments form is appending form submissions to the top of the page instead of their proper location.

Story:
I'm displaying multiple comments and multiple comment forms in a single panel pane. Structure looks like this:

panel_top
panel_mid
- node_1
- - comment_form
- node_2
- - comment_form
- node_3
- - view_list_comments
- - - comment_1
- - - comment_2
- - comment_form
- node_4
- - view_list_comments
- - - comment_1
- - comment_form
panel_btm

Nodes are listed in a view. Comments are listed under each node using an embedded view. Comment form is attached in a PHP views field for each node beneath the comments embedded view. The first two comments are displayed, and a comment form follows each one. Submitting the form works well, except it appends the #comment-wrapper-x to the top of the page instead of the view! I would _like_ the comments to appear on top (or beneath) the other existing comments for the corresponding node.

I don't think this backstory is so important, but maybe i'll help you wrap your head around it. I'm looking at line 228 of ajax_comments.module right now - the one that says

$commands[] = ajax_command_append('#comment-wrapper-' . $comment->pid, $notify_text . $comment_output);

... and I'm thinking that this is the place to start looking. Seeing the if/then statement there (lines 215-256) I would assume that the module isn't finding the associated comment-wrapper-x because it's up 2-3 levels and down 1 instead of wherever it SHOULD be. Thought it would be worth inquiring here though, you guys might have an idea or two as to where to check. Here are my questions:

  • Is it possible to specify the location for each comment to append to?
  • How can I re-route the module to search for the comment wrapper in a different place?
  • Is there a more efficient way to debug this module than trial-and-error?

If you can help and would like to take a look, please email me at emcniece@gmail.com and I will send you a link and anything else you need. It's a sensitive client, but I'm in a bind and really need a hand.

Many, MANY thanks for any thoughts you might have.

CommentFileSizeAuthor
#5 ajax_comments.patch1.7 KBGeorgique
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

acouch’s picture

I am noting this as a release blocker. I'll be working on this in the next couple of weeks.

acouch’s picture

Here is a temp solution that has worked for one user: #1447792: lifehack: simple way to use views comments with ajax comments

andypost’s picture

got same troubles here, suppose the issue title should be changed
comments should be appended after the parent comment and wrapper if no parent pointed

emcniece’s picture

very cool, thanks for wrangling post links acouch.

Georgique’s picture

Status: Active » Needs review
FileSize
1.7 KB

Please, look through this patch

Georgique’s picture

Version: 7.x-1.0-alpha1 » 7.x-1.x-dev
andypost’s picture

@Georgique patch looks good, +1 to commit
this could be useful not only for panels

acouch’s picture

Title: Multiple Panels/Views comments append to top of page, not pane or view » Multiple Panels comments append to top of page, not pane
Status: Needs review » Fixed

@andypost, thanks for the review. This has been committed: http://drupalcode.org/project/ajax_comments.git/commit/7ea3a86

I changed the title to reflect that this fix is for panels only.

Status: Fixed » Closed (fixed)

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