Needs review
Project:
AJAX Comments
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Aug 2012 at 23:05 UTC
Updated:
18 Dec 2018 at 05:07 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Asome commentedok I have now ajax_comments with quote support, I can quote with ajax and also quote "selected text"
Just need to finish it and found the time to commit :)
Comment #2
playfulwolf commentedready to be betatester :)
p.s. cannot use git, so when zip file is ready?
Comment #3
Asome commentedalmost ready, tonite or tomorrow I will commit it
Comment #4
mermemladeK commentedHello
Any news in this regard?
Thank you for the great module.
Comment #5
playfulwolf commentedAsome, still no news?
Comment #6
muschpusch commentedi'm setting this to normal. Asome could you provide a patch?
Comment #7
muschpusch commentedno feedback... closing this!
Comment #8
luco commentedreopening because... here's a patch!
it's basic functionality: once applied, this patch will cause all replies to include the original comment surrounded by
<blockquote>tags.please test.
if you like this patch, I'll add the needed granularity: checkboxes in the settings form to control quote support on a per- content type basis.
cheers,
Luciano
Comment #9
formatC'vt commentedWhat about Markdown and other text markups?
Comment #10
nickonom commentedPatch in #8 does nothing with regard to making Ajax Comment compatible with Quote. It just adds unnecessary tags.
Comment #11
happyblitz commentedI wanted to use both modules on my site, so i add changes in ajax_comment module.
It works for me.
If anyone want to apply patch and test it, tern off and then tern on ajax_comment module because i add a path in hook_menu.
Comment #12
nickonom commentedhappyblitz, thanks. works nice!
Comment #13
nickonom commentedhappyblitz, after some testing I found out it works only for comments. With the "Display the quote link for nodes" setting on
/admin/config/content/quotechecked on and using the following command innode.tpl.phpfile:print render($content['links']);it outputs something like:
and this doesn't work with ajax, while for comments it outputs:
and this works very well for comments.
Comment #14
sgdev commentedHave reworked this patch since it no longer cleanly applies to 7.x-1.x-dev.
Also found an issue where if a user replies to a comment and then immediately replies to another, the
comment_bodyis populated with the content entered in the first comment. There is now some extra logic to clear the#default_valueeach time.@nickonom, I understand your feedback, but I don't know how this module would be able to accomplish what you're seeking. All of the Ajax interactions that occur are done within the framework of comments. There are no Ajax wrappers connected to nodes. It is always going to redirect the node quote to a separate page.
If you wanted to accomplish something like that, it would need to be its own sub-module, or this module would need to be reworked to no longer be "Ajax Comments", but rather something like "Ajax Links" (fire Ajax functionality for any link attached to an entity, whether node, comment, etc.).
Comment #15
sgdev commentedSorry, just noticed there was one format problem from the previous patch that got carried over. The attached version fixes it so the code follows Drupal standards. Thanks.
Comment #16
sgdev commentedOne additional update to the previous patch.
After further testing, I noticed a problem. If a reply comment is submitted, and then I immediately attempt to reply to another comment, the comment body has a default value of the previously submitted comment.
The reason for this problem is connected to how the Drupal Ajax framework functions. If an entire form is rebuilt after one has been closed, and
drupal_html_idis being used to generate the form ID, it will have the same ID as the previous form. This causes the next instance of the form to pull the textarea value from cache rather than build cleanly.There are only two ways to avoid this problem:
1) Selectively rebuild form fields when they need to be updated, rather than build the entire form.
2) Clear the textarea value after the new form is built.
The approach I've taken to fix this is #2. This should really be its own patch, but I've included it here because we don't want textarea cleared if it is a quote. There needs to be extra conditional logic to handle this case.
I'll also post this as a separate patch with the hope that it can get reviewed and committed, and if I need to re-create the Quote support patch with the extra logic, I can do that later.
Please review, thanks.
Comment #17
sgdev commentedHere is the separate patch that includes only the code to fix the textarea problem:
https://www.drupal.org/project/ajax_comments/issues/3020827
Comment #18
sgdev commentedAs I mentioned here (https://www.drupal.org/project/ajax_comments/issues/3020827#comment-1289...), I forgot to remove one
console.logI put in the JavaScript file during testing.This new version removes that one extra line I had left in the code by accident.