You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
// If there are any orders, make sure that this is not allowed.
if (Order::find()->customerId($user->id)->status(null)->exists()) {
// TODO revise this stop-gap measure when Craft CMS gets a way to hook into the user delete process.
thrownewUserException(Craft::t('commerce', 'Unable to delete user {user}: the user has a Craft Commerce order.', [
'user' => $user->id,
]));
}
}
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.
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
The text was updated successfully, but these errors were encountered:
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:
commerce/src/services/Orders.php
Lines 188 to 200 in 8f6a112
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
The text was updated successfully, but these errors were encountered: