Do not throw exceptions for custom cancellation methods

Created on 11 December 2023, about 1 year ago

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.

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

🇳🇱Netherlands jaapjan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024