Could the UserException thrown during the pending user purge be reworked, we use sentry to monitor exceptions and this has added ~100k issues to our usage:
As the user is correctly not being deleted as the user (customer) has an order, could this not be handled - the activation code / state be removed, or event added to the user purge logic so commerce could hook into that and exclude users that have an order?
Also is there a reason you don't return theisValid = false and intead throw the excpetion?
You may set [[\yii\base\ModelEvent::$isValid]] to false to prevent the element from getting deleted.
What happened?
Could the UserException thrown during the pending user purge be reworked, we use sentry to monitor exceptions and this has added ~100k issues to our usage:
https://github.com/craftcms/commerce/blob/8f6a112deb4e01536d528dadc4e6351b9fc8f075/src/services/Orders.php#L188-L200
As the user is correctly not being deleted as the user (customer) has an order, could this not be handled - the activation code / state be removed, or event added to the user purge logic so commerce could hook into that and exclude users that have an order?
Also is there a reason you don't return the
isValid = false
and intead throw the excpetion?Impacts both 4.x and 5.x
Craft CMS version
4.10.8
Craft Commerce version
4.6.7
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
-