I'd like to use the Ajax Comments form via a views field. I will create a Views 'AJAX add comment' field and will post a patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | ajax_comments-views_integration-1711476-6.patch | 8.01 KB | grasmash |
| #1 | ajax_comments-views_integration-1711476-1.patch | 6.4 KB | grasmash |
Comments
Comment #1
grasmash commentedMore specifically, this will add a new Views field with an 'add comment' link. When clicked, the link will be replaced with the Ajaxified comment form. After submitting, it will replace the form with a message.
A few ideas for improvement:
- Allow the message to be customized either via the ajax comment settings page or on the views field settings form.
- Create an additional field for loading the current comments into a views field. i.e., ajax 'view comments' link.
Let me know if you'd like an modifications.
Thanks.
Comment #1.0
grasmash commentedclarity
Comment #2
druplerjr commentedWould love to see the view comments link functionality added.
Comment #3
nikkubhai commentedPlease check this issue: http://drupal.org/node/743040
Comment #4
grasmash commentedThis may address the same issue, but it's a completely different approach than the one taken in #743040: Ajax comments and views. My patch does not modify the module's javascript.
Maybe it's worth comparing the patches and choosing a path forward for this feature?
Comment #5
drupalgarm commentedHeyho.
I tried to integrate your patch and it seems to be successful.
But I got a "broken/missing Handler"-Message when I added the "Add AJAX Comment"-Field.
An idea?
Comment #6
grasmash commentedI've actually made a number of changes on my local installation since posting this patch. So, I've rerolled the patch. Please try this one out, I'll help troubleshoot if there's an issue.
Comment #7
simon georges commented@madmatter23, isn't Inline Ajax Comments what you want?
(Although, IMHO, merging both modules could be great, especially since Inline Ajax Comments doesn't seem to be maintained any more)
Comment #8
grasmash commented@Simon Georges
I found Inline Ajax Comments to be a mess. I worked with it for a while, and eventually gave up.
It was much easier to implement the feature with this module.
Comment #9
simon georges commented@madmatter Agreed (I think my team still has 4 or 5 patches in the issue queue), I look forward to have this working in a maintained module, good job!
Comment #10
gtn_john commented@madmatter This is a very useful patch. I really like your idea to:
I'm running into an issue where I've applied custom CSS to the form elements (which I am displaying in a block view, underneath the actual comments), but upon clicking "save" the form simply reverts back to the original styling, plus I need to do a manual page refresh to show the new comment in the list and get the custom styling back. Would integrating your proposed additional comments field get around this issue? Perhaps some sort of auto reload of that particular view to refresh the CSS and update the comments list. If not in a forthcoming patch, is there another way around this issue?
Thanks for the great work!
Comment #11
drupalgarm commentedHeyho.
I want to try your last patch, but i can´t find the "ajax_comments.js".
Where I can get these file?
Using 7.x-1.0-alpha1.
cya
*edit*
ajax_comments.js is in the dev-version.
Should I use dev for patching? Or should I integrate only this file into alpha1?
Comment #12
drupalgarm commentedAhoi.
I´ve tried to run the 6-patch with the dev-version: no success.
I´ve tried to run the 1-patch with dev and afterwards 6-patch: no success.
Error-msg for patching:
File to patch: ajax_comments_nodejs.info
patching file ajax_comments_nodejs.info
Hunk #1 FAILED at 2.
1 out of 1 hunk FAILED -- saving rejects to file ajax_comments_nodejs.info.rej
other files was patched successfully.
----------------
Pls help me *g*
Comment #13
mvlabat commentedTry to apply this patch manually: just add a new line "files[] = views_handler_field_ajax_add_comment.inc" after "configure = admin/config/content/ajax_comments" into the .info file.
Comment #14
drupalgarm commentedHeyho.
I integrated two lines manually, first one in ajax_comments.info (look at #13) and second in ajax_comments_nodejs.info (delete one empty line as shown in .rej-file).
But I get a notice if I load comment-control-page (admin/content/comment).
Notice: Undefined property: stdClass::$comment_body in comment_admin_overview() (Zeile 107 von drupal\modules\comment\comment.admin.inc).
It works well, but I can´t see the created comment without loading the single node. I want to avoid this behavior ;)
Is there a solution planned?
But the "Add Comment"-Link works fine :)
cya
Comment #15
tostinni commented@Garm try to patch it using
git apply ajax_comments-views_integration-1711476-6.patchversus the traditionnal methodpatch -p1 < ajax_comments-views_integration-1711476-6.patch.Using the former works for me while the latter display the error you mention.
This patch needs to be applied to the dev version.
@madmatter23 I created a patch (#1837468: [views integration] add a field to list all comments of a node) to display the list of comments. I look forward to receiving some feedback.
Comment #16
muschpusch commentedCould you please reroll the patch? I used the current dev but it doesn't apply...
Comment #17
muschpusch commentedaaah! no sorry the dev release isn't up to date. If you checkout by git (7.x) the patch applies! When downloading the release on the project page it doesn't. I think the master branch should be updated or even better deleted!
Comment #18
muschpusch commentedOne more remark to get this working: you need to choose a content type at: admin/config/content/ajax_comments
Even though it says that:
Not sure if it's related to this patch...
madmatter23++ this is nice!
Comment #19
muschpusch commentedok this is committed! Thanks madmatter23
Comment #19.0
muschpusch commentedagain