truonglv
Well-known member
- Affected version
- 2.2.8
I have been setup to allow user can delete their account which used \XF\Service\User\Delete service.
But with the line 55 in service it resets all options and then when invoke delete() again; it triggers preDelete again without above custom option set.
Note: It's will work if I didn't provide renameTo value.
PHP:
/** @var \XF\Service\User\Delete $deleter */
$deleter = $this->service('XF:User\Delete', $visitor);
$deleter->renameTo('guest-' . time());
$deleter->getUser()->setOption('allow_self_delete', true);
if (!$deleter->delete($errors)) {
return $this->error($errors);
}
But with the line 55 in service it resets all options and then when invoke delete() again; it triggers preDelete again without above custom option set.
Note: It's will work if I didn't provide renameTo value.