Hi,

I got this error message when trying to cancel user with the admin/people page :

Notice : Undefined index: post dans administerusersbyrole_form_user_multiple_cancel_confirm_alter() (ligne 141 dans /home/www/sustainable/sites/all/modules/administerusersbyrole/administerusersbyrole.module).
Warning : array_filter() expects parameter 1 to be array, null given dans administerusersbyrole_form_user_multiple_cancel_confirm_alter() (ligne 141 dans /home/www/sustainable/sites/all/modules/administerusersbyrole/administerusersbyrole.module).
Warning : Invalid argument supplied for foreach() dans administerusersbyrole_form_user_multiple_cancel_confirm_alter() (ligne 141 dans /home/www/sustainable/sites/all/modules/administerusersbyrole/administerusersbyrole.module).

I've made a patch.

Files: 
CommentFileSizeAuthor
#23 multiple_cancel-1680156-23.patch957 bytesmlee11111
PASSED: [[SimpleTest]]: [MySQL] 1,141 pass(es).
[ View ]
#14 0001-Issue-1680156.patch1.23 KBhenrikenji
PASSED: [[SimpleTest]]: [MySQL] 1,141 pass(es).
[ View ]
#8 1680156_8.patch946 bytesGiorgosK
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in 1680156_8.patch.
[ View ]
#5 1680156_5.patch946 bytesGiorgosK
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in 1680156_5.patch.
[ View ]
administerusersbyrole.patch1.48 KBepieddy
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch administerusersbyrole.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Comments

Status:Needs review» Needs work

The last submitted patch, administerusersbyrole.patch, failed testing.

I also have the same problem. Even if one user is selected.

I also - same problem. Drupal 7.15.

I WAS able to cancel user accounts recently, just a few days or weeks earlier, though - I am not sure if this module was enabled then, but I think it was. So this may be due to a recent new version of this or some other module. If I pin this down, I plan to post the result back here.

I mentioned being able to cancel accounts - I disabled the administerusersbyrole module and still could not cancel (delete completely). So the inability to cancel accounts seems unrelated to this issue.

But I changed the index 'post' to 'input' as in the patch, and that did eliminate the error messages.

Version:7.x-1.0-beta1» 7.x-1.x-dev
StatusFileSize
new946 bytes
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in 1680156_5.patch.
[ View ]

same problem with DEV version (from 16 sep)
but disabling the module lets you actually cancel accounts
(which means the errors are caused by the module)

the patch the OP actually takes a way lots of lines (I think with no reason)

here is an updated patch that fixes this issue

it seems with drupal 7.17
patch is no longer needed ?!!

For me with drupal 7.17 and Administer Users by Role 7.x-1.0-beta1 the bug is still there :

Notice : Undefined index: post dans administerusersbyrole_form_user_multiple_cancel_confirm_alter() (ligne 141 dans .....sites/all/modules/administerusersbyrole/administerusersbyrole.module).
Warning : array_filter() expects parameter 1 to be array, null given dans administerusersbyrole_form_user_multiple_cancel_confirm_alter() (ligne 141 dans ...../sites/all/modules/administerusersbyrole/administerusersbyrole.module).
Warning : Invalid argument supplied for foreach() dans administerusersbyrole_form_user_multiple_cancel_confirm_alter() (ligne 141 dans ..../sites/all/modules/administerusersbyrole/administerusersbyrole.module).

I just verify that the patch is already apply by default with this version 7.x-1.0-beta1

StatusFileSize
new946 bytes
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in 1680156_8.patch.
[ View ]

Sorry I got confused
the previous patch in #5 was reversing the patch from Original post
and therefore the patch is still needed (my previous statement was not correct)

try this one on the latest dev version
its only the necessary changes from original

@Zorax
this patch is not included in any version I believe you have to apply it yourself

it works for me,
thank you !

Status:Needs work» Fixed

The last patch (1680156_8.patch) works for me too.

Execute that patch or edit administerusersbyrole.module file manually as following steps:

1) find administerusersbyrole.module at "../sites/all/modules/administerusersbyrole/"
2) find and replace this line: foreach (array_filter($form_state['post']['accounts']) as $uid => $value) {
with this: foreach (array_filter($form_state['post']['accounts']) as $uid => $value) {

3)& find and replace this line: unset($form_state['post']['accounts'][$uid]);
with this: unset($form_state['input']['accounts'][$uid]);
4)Save the file, and upload this file again if you edit it on your local machine.
finished!

the only change we have to make is replacing 'post' to 'input' inside the "administerusersbyrole_form_user_multiple_cancel_confirm_alter" function. it will solve the problem.

Status:Fixed» Reviewed & tested by the community

this is not a support request
fixed on a bug report is for maintainer to assign after the patch has been applied

Status:Reviewed & tested by the community» Needs work

The last submitted patch, 1680156_8.patch, failed testing.

Hello,

At #10 I think you mean:

2) find and replace this line: foreach (array_filter($form_state['input']['accounts']) as $uid => $value) {

I think you forget to change "post" to "input" Is it right or do I stupid things?

After that the patch #10 seems to work for me.

Best regards
Frank

StatusFileSize
new1.23 KB
PASSED: [[SimpleTest]]: [MySQL] 1,141 pass(es).
[ View ]

Re-rolling patch against dev.

Status:Needs work» Needs review

Status:Needs review» Reviewed & tested by the community

I will go ahead and put at RTBC
its been tried by many people before

it works with latest dev and latest 7.21 drupal

#14 works with the latest dev and drupal 7.15.

Thanks.

++ for the #14 patch. Works for me too.

Hello,

#14 works for me..thanks a lot!

Best regards
Frank

Hello,

with the latest dev (2013-May-14) I get a new error when I apply the patch:

Notice: Undefined index: status in administerusersbyrole_form_user_profile_form_alter() (line 190 of /.../sites/all/modules/administerusersbyrole/administerusersbyrole.module).

Any ideas in that?

Best regards
Frank

I assume this patch was not committed to latest dev? Just installed drupal yesterday and installed your latest dev module. Not working.

i came up with the same fix and only now found this report when wanting to report it. not sure since when "post" got renamed to "input" but i guess it would be good to merge this patch!

StatusFileSize
new957 bytes
PASSED: [[SimpleTest]]: [MySQL] 1,141 pass(es).
[ View ]

Recreating patch for #14 as a patch file for use by our Drush make script.

Re: comment #20:

This is a duplicate of issue: https://drupal.org/node/2059429

I wrote a simple patch for this: https://drupal.org/node/2059429#comment-7999167

#23 worked for me.

Thanks.