Based on the comments in http://drupal.org/node/84076 and http://drupal.org/node/83007, the workflow of deleting forum and multiple comments can be improved. The workflow of deleting multiple users can also be improved.

This patch does the following for deleting multiple comments, multiple users, and forum/container:

1. Designate separate menu callback for deletion of forums, comments, and users respectively.
2. Operation will be checked at the _submit hook of the admin overview page of each module. The respective delete menu callback will be called accordingly.
3. Usage of $_POST along the process was removed.

For comment and user module only:
1. Since $_POST is not used anymore, the array of multiple comments and users cannot be passed to the callback. To solve this, cid of comments and uid of users are appended respectively at the end of the delete menu item, imploded with the '+' symbol.
2. The string of cids/uids are exploded into arrays at the callback function. The deletion process after that remains the same.

The confirm form for deleting forum/container was also changed to reflect the type of term to be deleted.

Please review, maybe the patch could be improved further or maybe breaking it up is better?

Comments

edmund.kwok’s picture

Title: Improving comment, forum and user module's multiple delete workflow » Improving delete workflow of comment, forum and user module

Better title.

edmund.kwok’s picture

StatusFileSize
new9.76 KB

Previous patch didn't work for multiple delete because I was not aware that '+' might be parsed as ' '. In this patch, ',' comma was used instead, following taxonomy module where ',' means 'and' instead of using '+' which means 'or'. Also changed the delete forum/container's callback argument to only the form_id.

drumm’s picture

Status: Needs review » Needs work

Can you post patches to each of the three files separately. I'd rather review and test one change at a time than three.

edmund.kwok’s picture

StatusFileSize
new2.7 KB

For comment.module.

edmund.kwok’s picture

StatusFileSize
new2.87 KB

For user.module

edmund.kwok’s picture

StatusFileSize
new5.72 KB

For forum.module. Rerolled to latest HEAD version since the interim fix got in.

edmund.kwok’s picture

Status: Needs work » Needs review

Changing status...

edmund.kwok’s picture

Title: Improving delete workflow of comment, forum and user module » Separate menu callback when deleting comment(s), forum and user(s)
StatusFileSize
new2.87 KB

Rerolling to latest HEAD for user.module. Please reset your menu cache before testing the changes.

Changing the title to reflect overall changes of patch.

drumm’s picture

Version: x.y.z » 6.x-dev
Status: Needs review » Needs work

patching file modules/user/user.module
Hunk #1 FAILED at 723.
Hunk #2 succeeded at 2099 (offset 33 lines).
Hunk #3 succeeded at 2256 (offset 71 lines).
Hunk #4 FAILED at 2332.
patch unexpectedly ends in middle of line
2 out of 4 hunks FAILED -- saving rejects to file modules/user/user.module.rej
patch unexpectedly ends in middle of line

edmund.kwok’s picture

Status: Needs work » Needs review
StatusFileSize
new2.87 KB

Rerolled to HEAD.

edmund.kwok’s picture

StatusFileSize
new3.56 KB

Patch for comment.module. Rerolled to head. Also removed content_admin() since it's not longer required with the separate menu callbacks.

catch’s picture

Status: Needs review » Needs work

Great idea, doesn't apply unfortunately. Any chance of this getting into D6 for usability?

mxer269’s picture

Is this patch what I need? I am unable to delete my forums and forum containers. I am having trouble assigning a URL alias to my forum link as well, although I've done it correctly. Nothing shows up when you click the forum link.

mxer269’s picture

The forum does not show when I set a URL alias to the forum

mxer269’s picture

bump for help pls

multiplextor’s picture

Status: Needs work » Closed (won't fix)

Closed. The reason: expired.