Problem/Motivation

When in the admin/people page, checking more than a box or two and selecting the "Cancel the selected user accounts" action from the "Update Options" dropdown, the resulting form shows a "Require e-mail confirmation to cancel accounts" checkbox. However, the \Drupal\user\Form\UserMultipleCancelConfirm::submitForm method does not do anything with this checkbox value, in contrast to the singular \Drupal\user\Form\UserCancelForm::submitForm method. Accounts are always immediately cancelled.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#98 1599286-user_cancel_confirmation_does_not_work_with_user_cancel_action-MR2958.patch5.66 KBvensires
#83 1599286--after--patch-1.png43.73 KBvikashsoni
#83 1599286--after--patch--pic.png28.76 KBvikashsoni
#83 1599286--before--patch--pic-2.png28.82 KBvikashsoni
#83 1599286--before--patch--pic-1.png29.99 KBvikashsoni
#81 interdiff_79-81.txt6.79 KBmeenakshi_j
#81 1599286-81.patch4.67 KBmeenakshi_j
#79 drupal-core-user-cancel-confirm-multiple-1599286-79.patch4.06 KBattila.fekete
#78 drupal-core-user-cancel-confirm-multiple-1599286-78.patch3.6 KBattila.fekete
#77 1599286-77.patch4.21 KBkapilv
#76 1599286-76.patch4.19 KBkapilv
#75 drupal-core-user-cancel-confirm-multiple-1599286-75.patch3.6 KBattila.fekete
#62 1599286-62-d8-user-cancel-confirm-multiple-with-test.patch3.78 KBdonutdan4114
#61 1599286-61-d8-user-cancel-confirm-multiple-fix.patch1.6 KBdonutdan4114
#43 drupal8-confirm_user_cancel_with_tests-1599286-43.patch3.42 KBdonutdan4114
#41 drupal8-confirm_user_cancel_with_tests-1599286-41.patch3.28 KBdonutdan4114
#39 drupal8-confirm_user_cancel_with_tests-1599286-39.patch3.28 KBdonutdan4114
#37 drupal8-confirm_user_cancel_with_tests-1599286-37.patch3.25 KBdonutdan4114
#35 drupal8-confirm_user_cancel_with_tests-1599286-35.patch3.21 KBdonutdan4114
#31 drupal7-confirm_user_cancel_with_tests-1599286-31.patch3.61 KBdonutdan4114
#31 interdiff.txt3.47 KBdonutdan4114
#28 drupal7-confirm_user_cancel_with_tests-1599286-28.patch3.61 KBdonutdan4114
#28 interdiff.txt3.47 KBdonutdan4114
#30 drupal8-confirm_user_cancel_with_tests-1599286-29.patch3.71 KBdonutdan4114
#30 interdiff.txt818 bytesdonutdan4114
#27 drupal8-confirm_user_cancel_with_tests-1599286-27.patch3.72 KBdonutdan4114
#27 interdiff.txt1.07 KBdonutdan4114
#24 drupal8-confirm_user_cancel_with_tests-1599286-24.patch0 bytesdonutdan4114
#24 interdiff.txt1.07 KBdonutdan4114
#25 drupal8-confirm_user_cancel_with_tests-1599286-25.patch3.72 KBdonutdan4114
#22 drupal8-confirm_user_cancel_with_tests-1599286-22.patch3.72 KBdonutdan4114
#19 drupal8-confirm_user_cancel_with_tests-1599286-19.patch3.74 KBdonutdan4114
#16 drupal8-confirm_user_cancel_with_tests-1599286-16.patch4.41 KBdonutdan4114
#15 drupal7-confirm_user_cancel_with_tests-1599286-15.patch4.29 KBdonutdan4114
#6 drupal8-cancel_user_email_fix-1599286-6.patch1.7 KBdonutdan4114
#1 drupal-cancel_user_email_fix-1599286-1.patch1.68 KBdonutdan4114

Issue fork drupal-1599286

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

donutdan4114’s picture

Status: Active » Needs review
StatusFileSize
new1.68 KB

I think I fixed the issue, submitting my first patch ever..

dandaman’s picture

In my quick test of creating a couple accounts and trying to delete them it seems like it worked for me. Thanks!

donutdan4114’s picture

Status: Needs review » Reviewed & tested by the community
David_Rothstein’s picture

Version: 7.x-dev » 8.x-dev
Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs backport to D5

Thanks for the patch! However, I assume this issue exists in Drupal 8 too, in which case it needs to be fixed there and backported.

Also looks like a possible duplicate of #935232: "Require e-mail confirmation to cancel account" when cancelling multiple accounts., although since this issue already has a patch I'll mark that one duplicate instead.

David_Rothstein’s picture

Whoa, I definitely added the wrong tag there :)

donutdan4114’s picture

Status: Needs work » Needs review
StatusFileSize
new1.7 KB

Here's Drupal 8 version of the patch.
Not sure how to backport... But now this thread has both patches in it :)

donutdan4114’s picture

Can anyone review this properly for Drupal 8?

I don't have a mail server set up and I think this is a pretty important fix actually.

donutdan4114’s picture

Assigned: Unassigned » donutdan4114
Status: Needs review » Reviewed & tested by the community
David_Rothstein’s picture

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

Nice work @donutdan4114... generally we don't rtbc our own patches!

Also as this is a bug we need to write a test to make sure we don't break this in the future... You need to write a simpletest (https://drupal.org/simpletest) and this will help you test emails... http://api.drupal.org/api/drupal/modules%21simpletest%21drupal_web_test_...

donutdan4114’s picture

Issue tags: -Needs tests

Thanks for the info @alexpott, not sure when I'll have enough time to do those tests. If someone else wants to write the tests, that'd be helpful...

alexpott’s picture

Issue tags: +Needs tests

Restoring tag

alexpott’s picture

Wow d.o it says I've added the tag but it didn't really add! lets try again...

donutdan4114’s picture

Issue tags: -Needs backport to D7

Drupal7 patch is in comment #1.

donutdan4114’s picture

Version: 8.x-dev » 7.x-dev
Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new4.29 KB

Drupal 7 patch with tests (cannot currently get Drupal 8 setup on my local).

donutdan4114’s picture

Version: 7.x-dev » 8.x-dev
StatusFileSize
new4.41 KB

Attempting to roll D8 patch even though I can't install D8 on my local yet.

alexpott’s picture

Status: Needs review » Needs work

@donutdan4114 thanks for the work!

+++ b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.phpundefined
@@ -438,4 +438,57 @@ function testMassUserCancelByAdmin() {
+   * Create multiple users and sends e-mail notifications to confirm account deletion.

Should be less than 80 chars and start with Creates (see http://drupal.org/coding-standards)... but as this is a test it should be something like: Tests e-mail notification during multiple user cancellation.

+++ b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.phpundefined
@@ -438,4 +438,57 @@ function testMassUserCancelByAdmin() {
+    config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
+    // Enable account cancellation notification.
+    config('user.settings')->set('notify.status_canceled', TRUE)->save();

This should be written like this:

    Drupal::config('user.settings')
      ->set('cancel_method', 'user_cancel_reassign')
      ->set('notify.status_canceled', TRUE)
      ->save();
+++ b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.phpundefined
@@ -438,4 +438,57 @@ function testMassUserCancelByAdmin() {
+    $this->assertText(t('Are you sure you want to cancel these user accounts?'), 'Confirmation form to cancel accounts displayed.');
+    $this->assertText(t('When cancelling these accounts'), 'Allows to select account cancellation method.');
+    $this->assertText(t('Require e-mail confirmation to cancel account.'), 'Allows to send confirmation mail.');
+    $this->assertText(t('Notify user when account is canceled.'), 'Allows to send notification mail.');

It's not really necessary to test the text here - this patch has not changed the text.

+++ b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.phpundefined
@@ -438,4 +438,57 @@ function testMassUserCancelByAdmin() {
+    $status = TRUE;

With the changes suggested before we can remove this.

+++ b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.phpundefined
@@ -438,4 +438,57 @@ function testMassUserCancelByAdmin() {
+      $status = $status && (strpos($this->content, t('A confirmation request to cancel %name account has been sent to %mail address.', array('%name' => $account->name, '%mail' => $account->mail))) !== FALSE);

We should just assert that each message appears in the content here...

+++ b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.phpundefined
@@ -438,4 +438,57 @@ function testMassUserCancelByAdmin() {
+      $user = user_load($account->uid, TRUE);
+      // Account exists.
+      $status = $status && $user;
+      // Make sure account is still enabled.
+      $status = $status && $user->status;
+    }
+    $this->assertTrue($status, 'Users are found in the database.');

Rather than combining all the assertions in to one just $this->assertTrue($user->status, "User still enabled after cancel confirmation sent"); or something like that.

+++ b/core/modules/user/user.moduleundefined
@@ -1642,13 +1642,20 @@ function _user_cancel($edit, $account, $method) {
+        drupal_set_message(t('A confirmation request to cancel %name account has been sent to %email address.',array('%name'=>$account->name,'%email'=>$account->mail)));

Missing a spaces and I think the message can be improved (which means the test has to change).. something along the lines of drupal_set_message(t('Cancellation request sent to %email.', array('%email' => $account->mail)));

twistor’s picture

*edit Alexpott got to it first.

donutdan4114’s picture

Status: Needs work » Needs review
StatusFileSize
new3.74 KB

Updated patch based on @alexpott recommendations.

Status: Needs review » Needs work

The last submitted patch, drupal8-confirm_user_cancel_with_tests-1599286-19.patch, failed testing.

tim.plunkett’s picture

Just a couple more tweaks:

+++ b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.phpundefined
@@ -438,4 +438,52 @@ function testMassUserCancelByAdmin() {
     $this->assertEqual($user1->status, 1, 'User #1 still exists and is not blocked.');
   }
+
+
+  /**

Only need on blank line

+++ b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.phpundefined
@@ -438,4 +438,52 @@ function testMassUserCancelByAdmin() {
+  function testMassUserCancelByAdminConfirm() {

public function testMassUserCancelByAdminConfirm() {

+++ b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.phpundefined
@@ -438,4 +438,52 @@ function testMassUserCancelByAdmin() {
+    Drupal::config('user.settings')

This needs to be \Drupal::config('user.settings'), sorry about the confusion

+++ b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.phpundefined
@@ -438,4 +438,52 @@ function testMassUserCancelByAdmin() {
+    $admin_user = $this->drupalCreateUser(array('administer users'));
+    $this->drupalLogin($admin_user);

You can combine this, no need for a variable.
$this->drupalLogin($this->drupalCreateUser(array('administer users')));

+++ b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.phpundefined
@@ -438,4 +438,52 @@ function testMassUserCancelByAdmin() {
+      $account = $this->drupalCreateUser(array());

You don't need the array(), that's the default value

+++ b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.phpundefined
@@ -438,4 +438,52 @@ function testMassUserCancelByAdmin() {
+    // Send confirmation e-emails to users.
...
+      $this->assertText(t('Cancellation request sent to %email.', array('%mail' => $account->mail)));

+++ b/core/modules/user/user.moduleundefined
@@ -1642,13 +1642,20 @@ function _user_cancel($edit, $account, $method) {
+        drupal_set_message(t('Cancellation request sent to %email.', array('%email' => $account->mail)));

e-emails

+++ b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.phpundefined
@@ -438,4 +438,52 @@ function testMassUserCancelByAdmin() {
+      $this->assertTrue($user->uid, "User account exists.");
...
+      $this->assertTrue($user->status, "User account is enabled.");

Use single quotes unless double quotes are needed.

donutdan4114’s picture

Status: Needs work » Needs review
StatusFileSize
new3.72 KB

Thanks @tim.plunkett for more good feedback

Status: Needs review » Needs work

The last submitted patch, drupal8-confirm_user_cancel_with_tests-1599286-22.patch, failed testing.

donutdan4114’s picture

bad patch..

donutdan4114’s picture

Status: Needs work » Needs review
StatusFileSize
new3.72 KB

Uploading a non-empty patch this time.

Status: Needs review » Needs work

The last submitted patch, drupal8-confirm_user_cancel_with_tests-1599286-25.patch, failed testing.

donutdan4114’s picture

Status: Needs work » Needs review
StatusFileSize
new1.07 KB
new3.72 KB

Trying assertRaw().

donutdan4114’s picture

Trying to apply D7 patch to D8, doesn't work...

Status: Needs review » Needs work

The last submitted patch, drupal7-confirm_user_cancel_with_tests-1599286-28.patch, failed testing.

donutdan4114’s picture

Status: Needs work » Needs review
StatusFileSize
new818 bytes
new3.71 KB

Tiny update to the D8 patch.

donutdan4114’s picture

Version: 8.x-dev » 7.x-dev
StatusFileSize
new3.47 KB
new3.61 KB

D7 patch update.

donutdan4114’s picture

Bumping this, as it's been fixed for awhile and should be fixed in both Drupal 7 and 8.

tim.plunkett’s picture

Version: 7.x-dev » 8.x-dev

No one will review it if its marked for the wrong version.

tim.plunkett’s picture

donutdan4114’s picture

Created new Drupal 8 patch, the whole user cancellation process changed since the previous patch.

Status: Needs review » Needs work

The last submitted patch, drupal8-confirm_user_cancel_with_tests-1599286-35.patch, failed testing.

donutdan4114’s picture

Status: Needs work » Needs review
StatusFileSize
new3.25 KB

Try #2

Status: Needs review » Needs work

The last submitted patch, drupal8-confirm_user_cancel_with_tests-1599286-37.patch, failed testing.

donutdan4114’s picture

Status: Needs work » Needs review
StatusFileSize
new3.28 KB

Try #3

Status: Needs review » Needs work

The last submitted patch, drupal8-confirm_user_cancel_with_tests-1599286-39.patch, failed testing.

donutdan4114’s picture

Status: Needs work » Needs review
StatusFileSize
new3.28 KB

Changed $account->uid to $account->id()..

Status: Needs review » Needs work

The last submitted patch, drupal8-confirm_user_cancel_with_tests-1599286-41.patch, failed testing.

donutdan4114’s picture

Status: Needs work » Needs review
StatusFileSize
new3.42 KB

I think I figured out all the new D8 changes...

donutdan4114’s picture

Status: Needs review » Needs work

The last submitted patch, drupal8-confirm_user_cancel_with_tests-1599286-43.patch, failed testing.

donutdan4114’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, drupal8-confirm_user_cancel_with_tests-1599286-43.patch, failed testing.

donutdan4114’s picture

The last submitted patch, 31: drupal7-confirm_user_cancel_with_tests-1599286-31.patch, failed testing.

donutdan4114’s picture

Version: 8.x-dev » 7.x-dev
Issue summary: View changes
donutdan4114’s picture

donutdan4114’s picture

Status: Needs work » Needs review
fabianx’s picture

Generally the patch for D7 looks good to me.

The code is just weird for the user_mail() call to stop the flow of the function ...

Can we return or use else {} instead?

donutdan4114’s picture

Fabianx, not sure what you're referring to.

donutdan4114’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #31 still good for Drupal 7.

David_Rothstein’s picture

Version: 7.x-dev » 8.0.x-dev
Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs backport to D7

This still needs to be fixed in Drupal 8 first (https://www.drupal.org/core/backport-policy) - as far as I can see it wasn't fixed there yet.

donutdan4114’s picture

Status: Needs work » Needs review
StatusFileSize
new1.6 KB

Added logic in D8 when deleting multiple user accounts to listen to the user_cancel_confirm checkbox.

donutdan4114’s picture

Added test.

donutdan4114’s picture

Still needs review/RTBC.... 3 years in the making.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

dpi’s picture

Title: When Cancelling Multiple Users, Confirm Checkbox displayed but ignored » User cancel confirmation does not work with user cancel action
Version: 8.6.x-dev » 8.8.x-dev
Assigned: donutdan4114 » Unassigned
Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +user cancellation

Verified as an ongoing concern.

It seems the only way you can get to this page with core is through the 'user_cancel_user_action' Action plugin ( \Drupal\user\Plugin\Action\CancelUser)

Rewritten summary reflecting the current state of Drupal / appropriate references and terminology.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

attila.fekete’s picture

Since #62 does not apply on >= 8.9, I tried to do a reroll. Also did a few minor changes.

kapilv’s picture

Status: Needs work » Needs review
StatusFileSize
new4.19 KB

Fix Custom Commands Failed.

kapilv’s picture

StatusFileSize
new4.21 KB
attila.fekete’s picture

Status: Needs review » Needs work
StatusFileSize
new3.6 KB

Retry.

attila.fekete’s picture

And again.

attila.fekete’s picture

Version: 9.3.x-dev » 8.9.x-dev
Status: Needs work » Needs review
meenakshi_j’s picture

Version: 8.9.x-dev » 9.3.x-dev
StatusFileSize
new4.67 KB
new6.79 KB

Hi

Adding patch for 9.3.x for review.

Regarding #80: We ideally do the issue fixing in the latest fix version(9.3.x in this case) and generally do not back tag the core version unless we have a pressing reason to do so. The issue persists in the latest 9.3.x.

There were few deprecated functions used which I replaced respectively.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

vikashsoni’s picture

Applied patch #81 in drupal -9.3.x-dev
Applied successfully and looks good for me

For ref sharing screenshots ....

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

casey’s picture

Note that without #2829964 this feature only works for users that already have an active session.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

abelass’s picture

Composer cannot apply this patch with drupal 9.4.8

mxr576 made their first commit to this issue’s fork.

mxr576’s picture

Rerolled #81 patch for 10.1-dev and also improved how the issue is covered with tests. (For some reasons I could not generate a proper interdiff between #81 and my changes, sorry.)

#85 Thx for the heads up but if I am right that is not a blocker for solving this task.

Update: MR diff also applies on 9.4.8.

mxr576’s picture

mxr576’s picture

1) Drupal\Tests\user\Functional\UserCancelTest::testMassUserCancelConfirmByAdmin
All cancelled user accounts got a confirmation e-mail.
Failed asserting that actual size 2 matches expected size 3.

FTW, it passes on my local perfectly. Transient error? Let's retry...

christophweber’s picture

Status: Needs review » Reviewed & tested by the community

We have had a previous patch in production for months without issues. This latest MR adds welcome test coverage.
Moving to RTBC.

quietone’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work
Issue tags: +Bug Smash Initiative, +Needs issue summary update
Related issues: +#3028634: User account default setting for cancel confirm is not used

I'm doing a light review of RTBC issues. It is really exciting to see an older issue get to RTBC. Thanks everyone!

This really needs an Issue Summary update. Explaining the resolution is valuable to reviewers and committers. Adding tag for an update. I tested the patch, not rigorously, and it does appear to work. I have yet to do a code review.

quietone’s picture

I reviewed, looking at the comments mostly. I can't comment on the quality of the fix itself.

I did not when testing the change that the admin does not get a status message when the cancel action is taken. The other actions I tried to show a message.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

vensires’s picture

Attaching patch from current state of MR!2958.
Applies fine on latest Drupal 10.6.x.

The only drawback I have is that when the admin requires confirmation, the browser is redirected to the /admin/people page without any visible notification that the users were notified.