When admin want to cancel user's account he choose "Cancel the selected users accounts" option and click "Update". After it a page with a question "Are you sure you want to cancel these user accounts?' is opened. And under the question is "Add user" link and a name of user which will be deleted (see attached scr.). This link provides creating a new user account but when the user account was created admin is not redirected to the previous 'cancelling' page. Also more intuitively will be if the link "Add user" is to add more users accounts for deleting.

Comments

dustin.silva’s picture

I think the "+Add user" option is indeed confusing and should probably be removed from the "cancel account" modal. I will consult with a few Drupal friends of mine and see what they think our options are.

In my opinion, it makes no sense to click on "+Add user" while on the "cancel account" modal, unless the admin decided not to cancel those accounts, therefore, I see no reason to return to the cancel account modal.

dustin.silva’s picture

Once the related issue is taken care of (adding options to menu_local_action items) we can add a css tag and effectively hide the 'Add user' link on the 'cancel account' modal. Thanks Mikeytown2 for the input.

joe-b’s picture

Title: Admin is not redirected to 'cancel account page' after adding new user » Do not show 'Add user' menu local action option on account cancel confirm page
Version: 7.25 » 7.x-dev
StatusFileSize
new887 bytes

Seems to me that the most logical thing is to not have an 'Add user' menu option when you've just submitted the form to cancel user accounts. On the cancel form confirm page, there should be a single task.

Here's a patch to not show that menu local action on the cancel confirm form.

joe-b’s picture

Component: other » user.module
mikeytown2’s picture

#3 does look like it would do it. I was thinking of hiding it via CSS.

dustin.silva’s picture

tested #3, it works.

dustin.silva’s picture

Status: Active » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 3: 2177539-user-add-remove-on-cancel-3-D7.patch, failed testing.

mikeytown2’s picture

Status: Needs work » Needs review
mikeytown2’s picture

Status: Needs review » Reviewed & tested by the community

Test passes. Setting to RTBC. Noted though that there is some extra white space in the patch that should be removed.

+++ b/modules/user/user.module
@@ -3029,6 +3030,18 @@ function user_role_edit_access($role) {
+  }
+  ¶
+  return user_access($permission);

extra white space on the middle line

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 3: 2177539-user-add-remove-on-cancel-3-D7.patch, failed testing.

gaurav.goyal’s picture

StatusFileSize
new885 bytes

patch in #3 works fine, but there was an extra white space error in applying patch, this is fixed in the attached patch.

gaurav.goyal’s picture

Status: Needs work » Needs review
PascalAnimateur’s picture

It's working here also on the confirmation page when cancelling a user.
I'm looking for a way to also remove the "Add user" action link from the VBO confirmation page (i.e. with the module admin_views).

Any idea of how to access the current vbo form step from the user_create_access function proposed in the patch from #12?
Update: I found out there si no need to check for the cancel operation, at least in my case. Explanation and revised patch available here https://www.drupal.org/node/2299973#comment-8951509

vikashsoni’s picture

Applied #12 and #3 not working getting error sharing screenshot .....

mitthukumawat’s picture

StatusFileSize
new67.3 KB
new69.42 KB

Patch #12 applied successfully for me on drupal-7.80 version. And it has removed the add user option from account cancel confirmation page.
Adding screenshot for reference.

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.