Results
08.08.2020
crocheteer 8.x-1.0 ::
src/Annotation/HookUserCancel.php
* Annotation class for Hook User Cancel. * * @see \hook_user_cancel() * @see \Drupal\crocheteer\Plugin\Hook\User\HookUserCancelPlugin * @see \Drupal\crocheteer\Plugin\Hook\User\HookUserCancelPluginManager * @see \Drupal\crocheteer\EventSubscriber\HookUserCancelEventSubscriber * * @Annotation */
03.07.2024
decoupled_json_log 1.0.x-dev ::
src/Hook/DecoupledJsonLogHooks.php
/**
* Implements hook_user_cancel().
*/
#[Hook('user_cancel')]
public function userCancel(array $edit, UserInterface $account, string $method): void {
if ($method === 'user_cancel_reassign') {
// Anonymize json logs.
$storage = $this->entityTypeManager->getStorage('log_json'); 02.02.2018
display_fields 8.x-1.x-dev ::
includes/display_fields.field_ui.inc
* Submit handler that cancel the creation of a DisplayFields.
*/
function _display_fields_form_field_ui_create_display_fields_cancel($form, FormStateInterface $form_state) {
$triggering_element = $form_state->getTriggeringElement();
if ($triggering_element['#op'] == 'cancel') {
$form_state->unsetValue(['display_fields', 'create', 'field_type']);
$form_state->unsetValue(['display_fields', 'create', 'plugin_id']);
}
$form_state->setRebuild(); 02.07.2024
drupalorg_migrate 1.0.x-dev ::
src/Drush/Commands/DrushCommands.php
protected function cancelAccount($uid) {
// No need for extra logging as the user_cancel function does it.
user_cancel([], $uid, 'user_cancel_reassign');
$batch =& batch_get();
$batch['progressive'] = FALSE;
// Batch it the drush way, instead of batch_process().
drush_backend_batch_process();
$this->logger()->warning(\dt('Deleting user @uid via sync-users drush command.', [ 12.08.2021
eca 1.0.x-dev ::
modules/user/src/Hook/UserHooks.php
/**
* Implements hook_user_cancel().
*/
#[Hook('user_cancel')]
public function userCancel(array $edit, UserInterface $account, string $method): void {
$this->triggerEvent->dispatchFromPlugin('user:cancel', $account);
} 12.08.2021
eca 1.0.x-dev ::
modules/user/tests/src/Kernel/UserEventsTest.php
$this->assertSame('admin + admin + admin', ArrayWrite::$array['logout']);
user_cancel([], 2, 'user_cancel_block');
$this->assertSame('authenticated + authenticated + guest', ArrayWrite::$array['cancel']);
/** @var \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher */
$event_dispatcher = \Drupal::service('event_dispatcher');
$event_dispatcher->dispatch(new UserFloodEvent('ip', 10, 3600, '127.0.0.1'), CoreUserEvents::FLOOD_BLOCKED_IP);
$this->assertSame('[entity:account-name] + [account:account-name] + guest', ArrayWrite::$array['floodblockip']); 06.10.2020
editor_note 8.x-1.x-dev ::
editor_note.module
/**
* Implements hook_user_cancel().
*/
function editor_note_user_cancel($edit, UserInterface $account, $method) {
switch ($method) {
case 'user_cancel_reassign':
\Drupal::service('class_resolver')
->getInstanceFromDefinition(EntityHook::class)
->onUserCancel($account);
break; 04.01.2021
email_changelog 8.x-1.0-alpha1 ::
email_changelog.module
/**
* Implements hook_user_cancel().
*/
function email_changelog_user_cancel($edit, UserInterface $account, $method) {
$database = \Drupal::database();
$database->delete('email_changelog')
->condition('uid', $account->id())
->execute();
$database->update('email_changelog')
->fields(['logged_in_uid' => 0]) 26.09.2020
entity_abuse 1.1.x-dev ::
entity_abuse.module
/**
* Implements hook_user_cancel().
*/
function entity_abuse_user_cancel($edit, UserInterface $account, $method) {
/** @var \Drupal\entity_abuse\EntityAbuseServiceInterface $service */
$service = \Drupal::service('entity_abuse.service');
$service->userDelete($account);
} 07.08.2020
flag 8.x-4.x-dev ::
flag.module
/**
* Implements hook_user_cancel().
*/
function flag_user_cancel($edit, $account, $method) {
\Drupal::service('flag')->userFlagRemoval($account);
}
/**
* Implements hook_user_predelete().
*/ 05.10.2020
flag_lists 4.0.x-dev ::
flag_lists.module
/**
* Implements hook_user_cancel().
*/
function flag_lists_user_cancel($edit, UserInterface $account, $method) {
// Note, no revision handling implemented.
$flagListsService = \Drupal::service('flaglists');
switch ($method) {
case 'user_cancel_block_unpublish':
// There is no such thing as unpublish for Flagging Collections.
break; 15.03.2024
gamify 1.1.x-dev ::
gamify.module
/**
* Implements hook_user_cancel().
*/
function gamify_user_cancel($edit, UserInterface $account, $method) {
switch ($method) {
case 'user_cancel_block_unpublish':
// Unpublish gamify alerts.
$storage = \Drupal::entityTypeManager()->getStorage('gamify_alert');
$gamify_alert_ids = $storage->getQuery()
->condition('uid', $account->id()) 12.10.2020
group 8.x-1.x-dev ::
src/Hook/UserHooks.php
/**
* Implements hook_user_cancel().
*/
#[Hook('user_cancel')]
public function userCancel(array $edit, UserInterface $account, string $method): void {
// Reassign all groups to the super user.
if ($method == 'user_cancel_reassign') {
$storage = $this->entityTypeManager->getStorage('group'); 12.10.2020
group 8.x-1.x-dev ::
group.module
/**
* Implements hook_user_cancel().
*/
#[LegacyHook]
function group_user_cancel($edit, $account, $method) {
\Drupal::service(UserHooks::class)->userCancel($edit, $account, $method);
}
/**
* Implements hook_ENTITY_TYPE_update().
*/ 13.08.2020
group_permissions 1.0.0-alpha1 ::
group_permissions.module
/**
* Implements hook_user_cancel().
*/
function group_permissions_user_cancel($edit, $account, $method) {
// Reassign all group permissions revisions to the super user.
if ($method === 'user_cancel_reassign') {
/** @var \Drupal\group_permissions\Entity\Storage\GroupPermissionStorageInterface $storage */
$storage = \Drupal::entityTypeManager()->getStorage('group_permission');
// Group permission ids created by the account. 03.10.2020
hook_event_dispatcher 8.x-2.04 ::
modules/user_event_dispatcher/src/UserHookEvents.php
* * @see \Drupal\user_event_dispatcher\Event\User\UserCancelEvent * @see user_event_dispatcher_user_cancel() * @see hook_user_cancel() * * @var string */ public const USER_CANCEL = HookEventDispatcherInterface::PREFIX . 'user.cancel'; /**
03.10.2020
hook_event_dispatcher 8.x-2.04 ::
modules/user_event_dispatcher/tests/src/Kernel/UserEventTest.php
$this->listen(UserHookEvents::USER_CANCEL, 'onUserCancel');
user_cancel([], $this->user->id(), 'user_cancel_block');
}
/**
* Callback for UserCancelEvent.
*
* @param \Drupal\user_event_dispatcher\Event\User\UserCancelEvent $event 11.07.2025
inline_feedback 1.0.x-dev ::
inline_feedback.module
/**
* Implements hook_user_cancel().
*/
function inline_feedback_user_cancel($edit, UserInterface $account, $method): void {
switch ($method) {
case 'user_cancel_block_unpublish':
// Unpublish inline feedbacks.
$storage = \Drupal::entityTypeManager()->getStorage('inline_feedback');
$inline_feedback_ids = $storage->getQuery()
->condition('uid', $account->id()) 02.08.2022
knowledge 8.x-1.x-dev ::
knowledge.module
/**
* Implements hook_user_cancel().
*/
function knowledge_user_cancel($edit, UserInterface $account, $method) {
switch ($method) {
case 'user_cancel_block_unpublish':
/** @var \Drupal\knowledge\KnowledgeInterface[] $knowledge_links */
$knowledge_links = \Drupal::entityTypeManager()->getStorage('knowledge')->loadByProperties(['uid' => $account->id()]);
foreach ($knowledge_links as $know) {
$know->setUnpublished(); 18.03.2021
layout_builder_tomsaw 1.0.x-dev ::
layout_builder_tomsaw.module
/**
* Implements hook_user_cancel().
*/
function layout_builder_tomsaw_user_cancel(array $edit, UserInterface $account, string $method): void
{
switch ($method) {
case 'user_cancel_block_unpublish':
// Unpublish segments.
$storage = \Drupal::entityTypeManager()->getStorage('segment');
$segment_ids = $storage->getQuery() 