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.
As the title says, i am unable to delete comments whether it be single or multiple comments under /admin/content/comment.
me an ajk tried rolling back comment till worked..but nothing,it seems to have been broken for some time without being picked up
Comment | File | Size | Author |
---|---|---|---|
#9 | delete_multiple_comments_3.patch | 2.91 KB | edmund.kwok |
#4 | delete_multiple_comment_2.patch | 2.86 KB | edmund.kwok |
#3 | delete_multiple_comments.patch | 2.38 KB | edmund.kwok |
Comments
Comment #1
AjK CreditAttribution: AjK commentedcomment to get me subscribed
Comment #2
nickl CreditAttribution: nickl commentedBusy investigating...
Lots of fapi 2 clean up also required in comment.module
Comment #3
edmund.kwok CreditAttribution: edmund.kwok commentedFound the problem. The comments admin page is a callback to drupal_get_form() which takes 'comment_admin_overview' as an argument. In comment_admin_overview, when the operation is delete, comment_multiple_delete_confirm() returns a form array. The thing here is, the form is not rendered as the array is not passed to drupal_get_form().
Patch changes things by:
1. Setting the menu callback to comment_admin
2. Comment_admin will determine which form to render, comment_multiple_delete_confirm or comment_admin_overview
3. Comment_admin_overview is now a function that only builds the comment listing array
Please review.
Comment #4
edmund.kwok CreditAttribution: edmund.kwok commentedAh, confirm delete form was working in the previous patch but deleting still never took place. $edit in comment_multiple_delete_confirm_submit was not defined, this patch changed it to $form_values.
Btw, to get the patch working properly, you need to rebuild your menu.
Comment #5
AjK CreditAttribution: AjK commentedPatch applied clean.
Hmm, this just gives me
and still no multi-comment delete. I tried something similar along these lines (as used in user.module for multi-user delete which does work) and still it refused to budge.
Comment #6
edmund.kwok CreditAttribution: edmund.kwok commentedDid you try resetting your menu? Just browse to the menus admin page.
Comment #7
AjK CreditAttribution: AjK commentedStunning, lightning storm just took out all the power for a minute (so much for the UPS, lasted less than 45secs, need a bigger one).
When I came back to this (obviously after all my machines rebooted) bingo, works a treat! I guess Mother Nature cleared the cache for me (and scared the life out of my 3yrs old who didn't like the sudden dark).
I'd say RTBC but I'm sure Flk will come along and double check it. Thx for the patch
regards,
--AjK
Comment #8
flk CreditAttribution: flk commentedok, patch does what it says....
but patch was not rolled from drupal root (patches should always be rolled from drupal root :D ).
I dont like the way the confirm delete page is.. I think confirm pages should be on their own place and nothing to clutter/confuse the user. more like 'comment/delete/idhere' page.
eww just saw an ugly error when going to 'comment/delete/'. (shuffles off to report it)
Comment #9
edmund.kwok CreditAttribution: edmund.kwok commentedPatch was rerolled from Drupal root.
Using a 'comment/delete/cidhere' won't work as we are deleting multi comments. But I agree that using a specific menu callback like 'comment/delete' would be less confusing to the users and we can avoid using $_POST. That is beyond the scope of this patch IMO, and should be left for a separate task/feature report. Maybe then we can also revamp the deleting multiple users workflow to follow suit?
This patch follows the original workflow of deleting comments as close as possible to avoid changing a lot of codes. I'd say it fixes the bug as reported.
Comment #10
AjK CreditAttribution: AjK commentedI'd tend to agree that this patch resolves this issue.
For the record, applies clean and does what it says on the tin, fixes "broken multi-comment delete".
regards,
--AjK
Comment #11
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #12
(not verified) CreditAttribution: commented