Ajax comments doesn't works with advanced forum

CommentFileSizeAuthor
#1 forum_comment_fix_1748522.patch911 bytesnathanhilbert

Comments

nathanhilbert’s picture

Status: Active » Needs review
StatusFileSize
new911 bytes

Try attached patch to correct the target ajax callback for forums.

muschpusch’s picture

Status: Needs review » Postponed (maintainer needs more info)

What exactly is the problem when using advanced forums?

chimir’s picture

В advanced forum на срабатывает кнопка "ответить", не появляется форма для ответа

chimir’s picture

@ nathanhilbert thank you

formatC'vt’s picture

Issue summary: View changes

try latest dev, please

edaa’s picture

@formatC'vt

Thanks for your work, I have tried the latest 7.x-1.x-dev, the new comment can added, but there are 2 issues:

1) The comment order is wrong when I post multiple comments, since Advanced Forum resets $variables['class_array']:

function _advanced_forum_preprocess_comment(&$variables) {
   ...
    // Add in our classes overwriting existing.
    $variables['classes_array'] = array();
    $variables['classes_array'][] = 'forum-post clearfix';
    ...
}

so no 'ajax-comment-wrapper' class in real comment.

2) Advanced Forum changes the comment permalink to something such as #1, #2, #3 ..., when posting new comments, the permalink of ajax response is always '#2'.

formatC'vt’s picture

1) I think the best way is ask a maintainers of Advanced Forum do not do this $variables['classes_array'] = array(), because this is can crash any other modules too, or add for this option in admin interface (this option can be enabled by default for overwriting existing classes).

2) We are using default comment load feature, other modules who changing/altering something must do this every time.

formatC'vt’s picture

2) May be we can fix it, i check it on next week

formatC'vt’s picture

2) Hmm, this is can be easy to fix. Can you please find in ajax_comments_submit_js function this line:
$node = $form['#node'];
and replace it with:
$node = node_load($comment->nid, NULL, TRUE);
and check after this permalink.

edaa’s picture

Thank you! I will give it a try.

edaa’s picture

1) The comment order is wrong when I post multiple comments, since Advanced Forum resets $variables['class_array']:

duplicate of Keep default classes from Drupal core comments

formatC'vt’s picture

1. I submit a patch

2. Do you test it?

edaa’s picture

@formatC'vt
1. the patch works well.
2. sorry, I test it many times, it does not work.

formatC'vt’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

2. Advanced forum don't support ajax content update at this time (they need a javascript behavior for update permalink value for all of comments on content update)