Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In our use case, we are displaying a default message when there are no comments to display.
I have added ajax-comment-wrapper
and ajax-comment-dummy-comment
which allows ajax to add the new comment in the correct place.
Unfortunately, this also leaves the default message in place. We don't want it to be displayed when the comment is added.
Can the dummy comment be removed when the first comment is added.
Comment | File | Size | Author |
---|---|---|---|
#5 | ajax_comments-2637586-5.patch | 4.25 KB | John Cook |
#2 | ajax_comments-2637586-2.patch | 554 bytes | John Cook |
Comments
Comment #2
John Cook CreditAttribution: John Cook at Curve Agency commentedI have created a patch to remove the dummy comment using ajax when the first comment is submitted.
This will not re-add the dummy comment when the last comment is removed. This is not needed for our current use case as only administrators can delete comments. I will have a look at implementing this if I get the time.
Comment #3
formatC'vt CreditAttribution: formatC'vt as a volunteer commentedi agree, we should restore dummy comment when the last comment is removed.
Comment #4
formatC'vt CreditAttribution: formatC'vt as a volunteer commentedComment #5
John Cook CreditAttribution: John Cook at Curve Agency commentedI've re-implemented the functionality using ajax replace methods.
There is a extra text_format field in the configuration settings (admin/config/content/ajax_comments) to set the 'no comments' text.