I've completed the backport of this API. To work on this I've created a new cvs branch DRUPAL-6--2 and committed. I don't to make a new release of this yet because people could get confused trying to upgrade form 6.x-1.x to 6.x-2.x, and they are two
very different approaches.
DRUPAL-6--2 mimics exactly the way Drupal7 handle user cancellation (including user -> edit -> delete, and admin/user/user bulk operations). The only difference is that node, content, and other modules react to hook_user_cancel and hook_user_delete in D7, and in D6 these two hooks are implemented in user_delete.
There is a lot of code and things must be splitted, but it is working in both ways : foreach() loop when there are no more than 10 items to delete/update (nodes or comments) and in batch process when there are more than 10.
I did manual testing and extensive testing with devel-generate for using the batch api. Anyway, the module still needs testing when interacting with other modules (a required test is using another module that uses comment's module hooks).
There are a few @todos and @tasks in the .module file but could be solved easily. I'm putting the module in a live site for real test and will try to comment any issue I find.
Comment | File | Size | Author |
---|---|---|---|
#21 | user_delete-n935120-21.patch | 37.52 KB | DamienMcKenna |
Comments
Comment #1
ilo CreditAttribution: ilo commentedput this in the right place.
Comment #2
ilo CreditAttribution: ilo commentedSandbox is no longer active.
Comment #3
chuckbar77 CreditAttribution: chuckbar77 commentedsubscribing
Comment #4
DamienMcKennaThis has a number of improvements:
I've not tested this yet, but I did at lest run it through a lint test =)
Comment #5
DamienMcKennaoh yeah, the patch.
Comment #7
DamienMcKennaThe patch seemed to fail because the D6 Simpletest patch couldn't be applied?
Comment #8
DamienMcKennaAh, user_delete_access() was a duplicate function, so I renamed it to user_delete_delete_access().
Comment #10
DamienMcKennaIt'd help if I'd remember to create the patch correctly.
Comment #11
DamienMcKennaHonestly I think it'd be better to add these options to the existing user settings page (admin/user/settings).
Comment #12
DamienMcKennaThis patch moves the new settings into the main user settings form.
Comment #14
DamienMcKennaThis needs a little further work, after the user goes through and confirms the account to be deleted, at the end of the batch process the user is dumped at the batch?id=[id]&op=finished page with an "Access denied" message.
Comment #16
DamienMcKennaI appear to have resolved the problem of the unwanted error showing by adding a drupal_goto() to _user_delete_cancel().
Comment #17
DamienMcKennaThis is the correct patch.
Comment #20
DamienMcKennaFYI right now the messages are not displayed to the end user, so they get bounced back to the front page with no confirmation their account is gone. This is obviously not ideal.
Comment #21
DamienMcKennaThis fixes the calling of hook_comment in _user_delete_comment_save().
Comment #23
DamienMcKennaFYI I'm personally giving up trying to get v2 to work correctly, every time I run it the user is redirected to the 'finished' batch page and presented with a 403 error. v1 works well enough, just needs a static "your account has been deleted' page added.