Notify.cancel_confirm fix.
Make use of notify.cancel_confirm configuration and update tests.
Merge request reports
Activity
added 1 commit
- 047fdae6 - Make use of notify.cancel_confirm configuration and update tests.
- Resolved by mdranove
added 1 commit
- 30e16304 - Make use of notify.cancel_confirm configuration and update tests.
added 1 commit
- 346e6743 - Make use of notify.cancel_confirm config. Update tests.
added 1 commit
- db87760d - Click the cancel confirmation emails in BulkFormAccessTest.php.
added 1 commit
- 9f726875 - Check for notify.cancel_confirm default_value in tests. Fix logic in UserCancelForm.php.
added 1 commit
- a2cbe35a - Check for notify.cancel_confirm default_value in tests. Fix logic in...
added 1 commit
- 0935d3a4 - Add confirmation message to cancellation confirm action in UserMultipleCancelConfirm.php.
added 1 commit
- e18cb3ce - Only push usernames to username array if cancel_confirm true.
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)); 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') 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
Please register or sign in to reply