Problem/Motivation

Following up on #1711476: Views integration, we needed to include the list of comments in a view.

Proposed resolution

Create a views handler to display this list using ajax_comments, an option is available to add the comment form to post a new comment directly in the view.

Remaining tasks

It would be nice if an english native speaker could check up the strings.
If you have any suggestion, feel free to post them here to improve this handler.
We are working on a version to hide this list and open it with a click on a field that displays the number of comments.
Stay tuned.

Comments

tostinni’s picture

Status: Active » Needs review
StatusFileSize
new4.6 KB

Here is the patch.
It creates a new field for views named "list of comments", it has an option to display the "add comment" form.

muschpusch’s picture

Hey Tostinni, i reviewed the patch and it's great! I added two options to the list comments handler: view_mode & comments to show. I hope you like it. The view mode option isn't really useful if you don't use a module like display suite.

The patch attached is a combination of #1711476: Views integration and this one.

tostinni’s picture

Hi muschpusch, great to see you like it and yes, good catch for the options.
Currently I put a big number for comments to display in order to show everything but a configuration option is better.
Regarding your patch can you upload it again but without the "#" as it prevents your file to being downloaded.
Thanks.

muschpusch’s picture

Sorry! Here again!

tostinni’s picture

I can't find my feature (get a list of comments) in your patch have you removed it ?

muschpusch’s picture

pfff... git was confusing me or the other way around.. This one should be good!

muschpusch’s picture

I'm implementing it on a site right now and the second check confused me:


       if (user_access('post comments') && $node->comment == COMMENT_NODE_OPEN
           && (variable_get('comment_form_location_' . $node->type, COMMENT_FORM_BELOW) == COMMENT_FORM_BELOW
               && $this->options['ajax_comments_display_add_comment_form'])) {

Maybe remove the COMMENT_FORM_BELOW?!? We choose to show the form in views so it shouldn't be overwritten by a content type setting. What do you think? (And please tell me the last patch was good)

tostinni’s picture

You patch include the patch files you applied on your module so I don't think this is correct.
On another hand, I think it's better to keep patches relevant to their issue. My patch only add the list of comments with an option for the comment form. Your patch add mine plus the patch from #1711476: Views integration ;)

Anyway, regarding the second check yes we can remove it, I just took the code from comment_node_page_additions.

klucid’s picture

Sorry guys, but I'm fairly new to patching and need a little help. How would I go about applying this patch AFTER I've successfully applied this one to show the "add comment" link: http://drupal.org/node/1837468#comment-6777150 ?

tostinni’s picture

Hi klucid, which patch are you talking about ?
Because your link point to this same thread.

klucid’s picture

Hi Tostinni, thanks for the quick reply.

I apologize, I've applied the patch to add Ajax Comments to views: http://drupal.org/node/1711476#comment-6619792

tostinni’s picture

I'm not 100% sure but I think that the patch in #6 also add the "add comment" link, so you'd better not apply the patch of http://drupal.org/node/1711476#comment-6619792 and only add the one in this issue queue as I don't think both are compatibles.

klucid’s picture

Ok, thanks. I will try it out.

muschpusch’s picture

it's been a while but i think yes #6 is a combination of both of tostinni's patches with some options i added. I still think that the patch of tostinni is awesome so please test and review so that we can change status to rtbc

klucid’s picture

Thank you for your reply.

I've tested the patch in #6 and reinstalled the module, cleared cache, and cleared Views cache, but I don't see any options for showing the comments. The "Add comment" form still appears properly.

I've also tried adding the field "List of comments" but it does not refresh on submission of the Ajax comment form.

Any ideas? Thanks in advance!

muschpusch’s picture

Don't you have a views field with the name "list of comments"?

klucid’s picture

Yes, I added that field, but it doesn't refresh to show the new comment when a comment is submitted.

muschpusch’s picture

hey Klucid i'm co maintainer now and will commit all needed patches soon.

klucid’s picture

Thanks so much, muschpusch. I will look forward to it and will also test on my installation.

Thanks again!

muschpusch’s picture

I get some weird pager which shouldn't be there. Could you test this new patch? It should apply to the current dev

muschpusch’s picture

@klucid & @tostinni: i have to much to do at the moment could someone test the current patch against dev?

errev’s picture

Doesn't work

t apply -v ajax_comments_views_integration-1837468-20.patch
ajax_comments_views_integration-1837468-20.patch:55: trailing whitespace.

ajax_comments_views_integration-1837468-20.patch:58: trailing whitespace.
'#title' => t('View the add comment form'),
ajax_comments_views_integration-1837468-20.patch:59: trailing whitespace.
'#description' => t("Enable to display the add comment form below the list of comments."),
ajax_comments_views_integration-1837468-20.patch:60: trailing whitespace.
'#type' => 'checkbox',
ajax_comments_views_integration-1837468-20.patch:65: trailing whitespace.

Checking patch ajax_comments.info...
error: while searching for:
dependencies[] = comment
configure = admin/config/content/ajax_comments

files[] = views_handler_field_ajax_add_comment.inc
error: patch failed: ajax_comments.info:4
error: ajax_comments.info: patch does not apply
Checking patch ajax_comments.views.inc...
Checking patch ajax_comments_handler_field_list_comments.inc...

muschpusch’s picture

Did you apply the patch against current dev?

errev’s picture

Yep.

muschpusch’s picture

Status: Needs review » Fixed

Ok this is committed to current dev please test!

poterys’s picture

Comments still don't appear, need to refresh page..
But it works for reply, only page scrolls to top on "reply" clicking, and after posting comment.

muschpusch’s picture

What do you mean it doesn't work but works for reply? Could you post your view please?

poterys’s picture

StatusFileSize
new339.78 KB

I mean, when you try to post regular comment by clicking link "Add new comment" comment is saved, but automatically don't apear in list without refresh, only message appears that "comment is posted".

Making a reply to other comment it appears instantly without any problems.

errev’s picture

Hello Sir!
Can you post please a screen How your comments look like?
Thank you!

Status: Fixed » Closed (fixed)

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

dojorob76’s picture

Status: Closed (fixed) » Needs work

I can confirm the "Add New Comment" vs "Comment Reply" issue. When posting a new comment, the message "Your comment has been posted" appears, and the "Add New Comment" link disappears, but the comment itself does not show up until the page is refreshed. However, when editing, deleting, or replying to comments, everything works exactly as it should.

This appears to be an issue for several people, as it has shown up in many of the issues in this issue queue. (see: https://drupal.org/node/2016801, https://drupal.org/node/2046427, https://drupal.org/node/1918828) I have yet to find a fix that works.

I love this module. It is so perfect for my use case, but the comments are definitely not appearing until after a page refresh if they are new comments rather than replies.

dojorob76’s picture

Here is the link to a screencast showing exactly what's happening on a fresh install of Drupal 7 with the lastest dev version of AJAX Comments: http://www.youtube.com/watch?v=Uw5dSj4hqdI

(It is set to Unlisted, so can only be viewed through the link. I will take it down as soon as you've seen what you need to). I hope it's helpful.

muschpusch’s picture

Issue summary: View changes
Status: Needs work » Fixed

this should be fixed in latest dev!

  • muschpusch committed 0181d43 on 8.x-1.x
    Issue #1837468 by muschpusch, tostinni: Added [views integration] add a...

Status: Fixed » Closed (fixed)

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