Skip to content
Snippets Groups Projects

Notify.cancel_confirm fix.

Make use of notify.cancel_confirm configuration and update tests.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • mdranove added 1 commit

    added 1 commit

    • 30e16304 - Make use of notify.cancel_confirm configuration and update tests.

    Compare with previous version

  • mdranove added 1 commit

    added 1 commit

    • 346e6743 - Make use of notify.cancel_confirm config. Update tests.

    Compare with previous version

  • mdranove added 1 commit

    added 1 commit

    • db87760d - Click the cancel confirmation emails in BulkFormAccessTest.php.

    Compare with previous version

  • mdranove added 1 commit

    added 1 commit

    • 9f726875 - Check for notify.cancel_confirm default_value in tests. Fix logic in UserCancelForm.php.

    Compare with previous version

  • mdranove added 1 commit

    added 1 commit

    • 7a0c6bab - Disable cancel confirm in a few tests.

    Compare with previous version

  • mdranove added 1 commit
  • mdranove added 1 commit

    added 1 commit

    • a2cbe35a - Check for notify.cancel_confirm default_value in tests. Fix logic in...

    Compare with previous version

  • mdranove resolved all threads

    resolved all threads

  • mdranove added 1 commit

    added 1 commit

    • 0935d3a4 - Add confirmation message to cancellation confirm action in UserMultipleCancelConfirm.php.

    Compare with previous version

  • mdranove added 1 commit

    added 1 commit

    • e18cb3ce - Only push usernames to username array if cancel_confirm true.

    Compare with previous version

  • 502 502 // Delete the user created at the start of this test.
    503 503 // We need to POST here to invoke batch_process() in the internal browser.
    504 504 $this->drupalGet('user/' . $user->id() . '/cancel');
    505 $this->submitForm(['user_cancel_method' => 'user_cancel_reassign'], 'Confirm');
    505 $this->submitForm(['user_cancel_method' => 'user_cancel_reassign', 'edit-user-cancel-confirm' => 0], 'Confirm');
  • 123 123 $edit = [
    124 124 'user_cancel_method' => 'user_cancel_delete',
    125 125 ];
    126 $timestamp = time();
    126 127 $this->submitForm($edit, 'Confirm');
    127 128
    129 // Visit link in confirmation emails.
    130 $this->drupalGet("user/" . $account->id() . "/cancel/confirm/$timestamp/" . user_pass_rehash($account, $timestamp));
  • 517 516 * Create an administrative user and delete another user.
    518 517 */
    519 518 public function testUserCancelByAdmin(): void {
    520 $this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
    519 $this->config('user.settings')
  • 541 551 * Tests deletion of a user account without an email address.
    542 552 */
    543 553 public function testUserWithoutEmailCancelByAdmin(): void {
    544 $this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
    554 $this->config('user.settings')
  • 94 94 ];
    95 95 $form['user_cancel_method'] += $this->cancelMethods;
    96 96
    97 // When managing another user, can skip the account cancellation
  • 200 200
    201 201 // Clear out the accounts from the temp store.
    202 202 $this->tempStoreFactory->get('user_user_operations_cancel')->delete($current_user_id);
    203 $cancel_confirm = $form_state->getValue('user_cancel_confirm');
    203 204 if ($form_state->getValue('confirm')) {
    205 $usernames = [];
    204 206 foreach ($form_state->getValue('accounts') as $uid => $value) {
    205 207 // Prevent programmatic form submissions from cancelling user 1.
    206 208 if ($uid <= 1) {
    207 209 continue;
    208 210 }
    209 // Prevent user administrators from deleting themselves without confirmation.
    211 /* Prevent user administrators from deleting themselves without
  • 229 $user->user_cancel_notify = $form_state->getValue('user_cancel_notify');
    230 $user->save();
    231
    232 if ($cancel_confirm === 1) {
    233 _user_mail_notify('cancel_confirm', $user);
    234 }
    235 else {
    236 user_cancel($form_state->getValues(), $uid, $form_state->getValue('user_cancel_method'));
    237 }
    238 array_push($usernames, $user->label());
    239 $this->logger('user')->info('Sent account cancellation request to %name %email.',
    240 ['%name' => $user->label(), '%email' => '<' . $user->getEmail() . '>']);
    225 241 }
    226 242 }
    227 243 }
    244 /* If using a cancellation confirmation email add usernames to status
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading