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.
| Comment | File | Size | Author |
|---|---|---|---|
| #28 | commentsviews.jpg | 339.78 KB | poterys |
| #20 | ajax_comments_views_integration-1837468-20.patch | 4.12 KB | muschpusch |
| #6 | ajax_comments_views_integration-1837468-6.patch | 21.07 KB | muschpusch |
| #4 | ajax_comments_views_integration-1837468-2.patch | 4.39 KB | muschpusch |
| #2 | ajax_comments_views_integration-1837468-#2.patch | 4.39 KB | muschpusch |
Comments
Comment #1
tostinni commentedHere is the patch.
It creates a new field for views named "list of comments", it has an option to display the "add comment" form.
Comment #2
muschpusch commentedHey 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.
Comment #3
tostinni commentedHi 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.
Comment #4
muschpusch commentedSorry! Here again!
Comment #5
tostinni commentedI can't find my feature (get a list of comments) in your patch have you removed it ?
Comment #6
muschpusch commentedpfff... git was confusing me or the other way around.. This one should be good!
Comment #7
muschpusch commentedI'm implementing it on a site right now and the second check confused me:
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)
Comment #8
tostinni commentedYou 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.Comment #9
klucid commentedSorry 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 ?
Comment #10
tostinni commentedHi klucid, which patch are you talking about ?
Because your link point to this same thread.
Comment #11
klucid commentedHi 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
Comment #12
tostinni commentedI'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.
Comment #13
klucid commentedOk, thanks. I will try it out.
Comment #14
muschpusch commentedit'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
Comment #15
klucid commentedThank 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!
Comment #16
muschpusch commentedDon't you have a views field with the name "list of comments"?
Comment #17
klucid commentedYes, I added that field, but it doesn't refresh to show the new comment when a comment is submitted.
Comment #18
muschpusch commentedhey Klucid i'm co maintainer now and will commit all needed patches soon.
Comment #19
klucid commentedThanks so much, muschpusch. I will look forward to it and will also test on my installation.
Thanks again!
Comment #20
muschpusch commentedI get some weird pager which shouldn't be there. Could you test this new patch? It should apply to the current dev
Comment #21
muschpusch commented@klucid & @tostinni: i have to much to do at the moment could someone test the current patch against dev?
Comment #22
errev commentedDoesn'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...
Comment #23
muschpusch commentedDid you apply the patch against current dev?
Comment #24
errev commentedYep.
Comment #25
muschpusch commentedOk this is committed to current dev please test!
Comment #26
poterys commentedComments 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.
Comment #27
muschpusch commentedWhat do you mean it doesn't work but works for reply? Could you post your view please?
Comment #28
poterys commentedI 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.
Comment #29
errev commentedHello Sir!
Can you post please a screen How your comments look like?
Thank you!
Comment #31
dojorob76 commentedI 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.
Comment #32
dojorob76 commentedHere 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.
Comment #33
muschpusch commentedthis should be fixed in latest dev!