Results
05.03.2023
pm 4.1.x-dev ::
modules/pm_organization/pm_organization.module
/**
* Implements hook_user_cancel().
*/
function pm_organization_user_cancel($edit, UserInterface $account, $method) {
switch ($method) {
case 'user_cancel_reassign':
// Anonymize pm organizations.
$storage = \Drupal::entityTypeManager()->getStorage('pm_organization');
$pm_organization_ids = $storage->getQuery()
->condition('uid', $account->id()) 05.03.2023
pm 4.1.x-dev ::
modules/pm_expense/pm_expense.module
/**
* Implements hook_user_cancel().
*/
function pm_expense_user_cancel($edit, UserInterface $account, $method) {
switch ($method) {
case 'user_cancel_reassign':
// Anonymize pm expenses.
$storage = \Drupal::entityTypeManager()->getStorage('pm_expense');
$pm_expense_ids = $storage->getQuery()
->condition('uid', $account->id()) 05.03.2023
pm 4.1.x-dev ::
modules/pm_epic/pm_epic.module
/**
* Implements hook_user_cancel().
*/
function pm_epic_user_cancel($edit, UserInterface $account, $method) {
switch ($method) {
case 'user_cancel_reassign':
// Anonymize pm epics.
$storage = \Drupal::entityTypeManager()->getStorage('pm_epic');
$pm_epic_ids = $storage->getQuery()
->condition('uid', $account->id()) 05.03.2023
pm 4.1.x-dev ::
modules/pm_story/pm_story.module
/**
* Implements hook_user_cancel().
*/
function pm_story_user_cancel($edit, UserInterface $account, $method) {
switch ($method) {
case 'user_cancel_reassign':
// Anonymize pm stories.
$storage = \Drupal::entityTypeManager()->getStorage('pm_story');
$pm_story_ids = $storage->getQuery()
->condition('uid', $account->id()) 05.03.2023
pm 4.1.x-dev ::
modules/pm_board/pm_board.module
/**
* Implements hook_user_cancel().
*/
function pm_board_user_cancel($edit, UserInterface $account, $method) {
switch ($method) {
case 'user_cancel_reassign':
// Anonymize pm boards.
$storage = \Drupal::entityTypeManager()->getStorage('pm_board');
$pm_board_ids = $storage->getQuery()
->condition('uid', $account->id()) 05.03.2023
pm 4.1.x-dev ::
modules/pm_feature/pm_feature.module
/**
* Implements hook_user_cancel().
*/
function pm_feature_user_cancel($edit, UserInterface $account, $method) {
switch ($method) {
case 'user_cancel_reassign':
// Anonymize pm features.
$storage = \Drupal::entityTypeManager()->getStorage('pm_feature');
$pm_feature_ids = $storage->getQuery()
->condition('uid', $account->id()) 05.03.2023
pm 4.1.x-dev ::
modules/pm_timetracking/pm_timetracking.module
/**
* Implements hook_user_cancel().
*/
function pm_timetracking_user_cancel($edit, UserInterface $account, $method) {
switch ($method) {
case 'user_cancel_reassign':
// Anonymize pm timetrackings.
$storage = \Drupal::entityTypeManager()->getStorage('pm_timetracking');
$pm_timetracking_ids = $storage->getQuery()
->condition('uid', $account->id()) 05.03.2023
pm 4.1.x-dev ::
modules/pm_sub_task/pm_sub_task.module
/**
* Implements hook_user_cancel().
*/
function pm_sub_task_user_cancel($edit, UserInterface $account, $method) {
switch ($method) {
case 'user_cancel_reassign':
// Anonymize pm sub tasks.
$storage = \Drupal::entityTypeManager()->getStorage('pm_sub_task');
$pm_sub_task_ids = $storage->getQuery()
->condition('uid', $account->id()) 05.03.2023
pm 4.1.x-dev ::
modules/pm_note/pm_note.module
/**
* Implements hook_user_cancel().
*/
function pm_note_user_cancel($edit, UserInterface $account, $method) {
switch ($method) {
case 'user_cancel_reassign':
// Anonymize pm notes.
$storage = \Drupal::entityTypeManager()->getStorage('pm_note');
$pm_note_ids = $storage->getQuery()
->condition('uid', $account->id()) 05.03.2023
pm 4.1.x-dev ::
modules/pm_task/pm_task.module
/**
* Implements hook_user_cancel().
*/
function pm_task_user_cancel($edit, UserInterface $account, $method) {
switch ($method) {
case 'user_cancel_reassign':
// Anonymize pm tasks.
$storage = \Drupal::entityTypeManager()->getStorage('pm_task');
$pm_task_ids = $storage->getQuery()
->condition('uid', $account->id()) 12.12.2021
podcast_publisher 1.0.0-alpha3 ::
podcast_publisher.module
/**
* Implements hook_user_cancel().
*/
function podcast_publisher_user_cancel($edit, UserInterface $account, $method) {
switch ($method) {
case 'user_cancel_block_unpublish':
// Unpublish podcast episodes.
$storage = \Drupal::entityTypeManager()->getStorage('podcast_episode');
$podcast_episode_ids = $storage->getQuery()
->condition('uid', $account->id()) 14.05.2020
purge_users 8.x-2.0 ::
src/Services/UserManagementService.php
* {@inheritdoc}
*
* @see \_user_cancel()
*/
public function purgeUser(UserInterface $user, string $method) {
$logger = $this->loggerFactory->get('purge_users');
$edit = [];
// When the 'user_cancel_delete' method is used, user_delete() is called,
// which invokes hook_ENTITY_TYPE_predelete() and hook_ENTITY_TYPE_delete()
if ($method != 'user_cancel_delete') {
// Allow modules to add further sets to this batch.
/* @see \user_cancel() */
$this->moduleHandler->invokeAll('user_cancel', [$edit, $user, $method]);
}
switch ($method) {
case 'user_cancel_reassign':
// Reassign content to anonymous: 19.05.2025
qr_generator 1.0.1 ::
qr_generator.module
/**
* Implements hook_user_cancel().
*/
function qr_generator_user_cancel($edit, UserInterface $account, $method): void
{
switch ($method) {
case 'user_cancel_block_unpublish':
// Unpublish qr codes.
$storage = \Drupal::entityTypeManager()->getStorage('qr_code');
$qr_code_ids = $storage->getQuery() 01.09.2020
quiz 6.0.0-alpha4 ::
quiz.module
/**
* Implements hook_user_cancel().
*
* Reassign Quiz results to the anonymous user, if requested.
*/
function quiz_user_cancel($edit, $account, $method): void {
if ($method == 'user_cancel_reassign') {
Drupal::database()
->query("UPDATE {quiz_result} SET uid = 0 WHERE uid = :uid", [':uid' => $account->id()]);
}
} 04.06.2024
quiz_maker 1.0.6 ::
quiz_maker.module
/**
* Implements hook_user_cancel().
*/
function quiz_maker_user_cancel($edit, UserInterface $account, $method): void {
switch ($method) {
case 'user_cancel_block_unpublish':
// Unpublish quizzes.
$storage = \Drupal::entityTypeManager()->getStorage('quiz');
$quiz_ids = $storage->getQuery()
->condition('uid', $account->id()) 09.03.2022
rc 1.0.x-dev ::
rc.module
* Deactivate user chat account when user entity is blocked.
*
* Implements hook_user_cancel().
*
* @param $edit
* @param \Drupal\Core\Session\AccountInterface $account
* @param $method
*/
function rc_user_cancel($edit, AccountInterface $account, $method) {
$disableOptions = [
'user_cancel_block',
'user_cancel_block_unpublish',
];
if (in_array($method, $disableOptions)) {
$rcUser = \Drupal::service('rc.user'); 30.01.2022
reassign_user_content 1.0.1 ::
reassign_user_content.module
/**
* Implements hook_user_cancel().
*/
function reassign_user_content_user_cancel($edit, UserInterface $account, $method): void {
$user_to_assign_content = $edit['user_to_assign'] ?? NULL;
if ($method == 'user_cancel_reassign_content' && $user_to_assign_content) {
// Reassign nodes (current revisions).
\Drupal::moduleHandler()->loadInclude('node', 'inc', 'node.admin');
$nodes = \Drupal::entityQuery('node')
->accessCheck(FALSE)
* because _user_cancel supports only the methods added by UserCancelForm.
*
* @see _user_cancel()
*/
function reassign_user_content_batch_alter(&$batch): void {
$values = isset($batch['form_state']) ? $batch['form_state']->getValues() : [];
// Only go over the batch sets if we come from the form-submit
// of the user cancel form, and our method was selected.
if (
* Implements callback_batch_operation(). * * Similar to _user_cancel(). * * @param array $edit * An array of submitted form values. * @param \Drupal\user\UserInterface $account * The user ID of the user account to cancel. * @param string $method
* @throws \Drupal\Core\Entity\EntityStorageException
*
* @see _user_cancel()
*/
function reassign_user_content__reassign_user_content(array $edit, UserInterface $account, string $method): void {
$logger = \Drupal::logger('user');
if ($method == 'user_cancel_reassign_content') {
// Send account canceled notification if option was checked. 22.06.2020
recurly 8.x-1.x-dev ::
recurly.module
/** * Implements hook_user_cancel(). * * Cancel a Recurly account when the user account is canceled. It's important to * note this hook is *not* called if the user account is just being straight-up * deleted, which is fine because hook_entity_delete() will be called for that * situation. */
* situation.
*/
function recurly_user_cancel($edit, $account, $method) {
$entity_type = \Drupal::config('recurly.settings')->get('recurly_entity_type');
if ($entity_type === 'user') {
// Check for a local account first, no need to attempt to close an account
// if we don't have any information about it.
$local_account = recurly_account_load([
'entity_type' => $entity_type, 30.07.2020
role_expire 8.x-1.x-dev ::
role_expire.module
/**
* Implements hook_user_cancel().
*/
function role_expire_user_cancel($edit, UserInterface $account, $method): void {
// Delete user records.
\Drupal::service('role_expire.api')->deleteUserRecords($account->id());
}
/**
* Implements hook_user_delete(). 30.01.2023
simple_account_policy 1.0.0 ::
src/EventSubscriber/DefaultEventSubscriber.php
]));
user_cancel([
'user_cancel_notify' => 0,
'user_cancel_method' => $event->getCancelMethod(),
'user_cancel_confirm' => 0,
'uid' => $event->account->id(),
], $event->account->id(), $event->getCancelMethod());
$batch =& batch_get(); 