Problem/Motivation

After the update from 3.x to 4.x (latest beta) I noticed a lot of warnings in our logs. We are using a custom cancellation method configured on /admin/people/purge-rule but when a user is purged it throws an exception Unknown user cancel methodin the queue processing.

The users are being removed but not logged out automatically (because this exception is thrown) and the queue item will not be processed correctly.

Steps to reproduce

1. Create custom cancellation method via hook_user_cancel_methods_alter()
2. Implement custom handling for this cancellation method via hook_user_cancel()
3. Configure to use this custom method on /admin/people/purge-rule
4. Make sure you have a user which is going to be purged and run the cron.
5. You should see errors in the log causing the items not to be processed correctly.

Proposed resolution

Remove the throwing of the exception as this is the responsibility of the developer configuring this module anyway.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jaapjan created an issue. See original summary.

jaapjan’s picture

Status: Active » Needs review
ahmetburkan’s picture

Status: Needs review » Reviewed & tested by the community

Tested the changes and it works as expected. This is ready to be merged!

mably made their first commit to this issue’s fork.

mably’s picture

Small update: log is generated when method is unknown.

  • mably committed 7a0bc162 on 4.x authored by jaapjan
    #3407883: Do not throw exception for custom cancellation methods
    
mably’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.