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.
Comment | File | Size | Author |
---|---|---|---|
#23 | multiple_cancel-1680156-23.patch | 957 bytes | mlee11111 |
#14 | 0001-Issue-1680156.patch | 1.23 KB | henrikenji |
#8 | 1680156_8.patch | 946 bytes | GiorgosK |
#5 | 1680156_5.patch | 946 bytes | GiorgosK |
administerusersbyrole.patch | 1.48 KB | epieddy | |
Comments
Comment #2
aanjaneyam CreditAttribution: aanjaneyam commentedI also have the same problem. Even if one user is selected.
Comment #3
snowmountain CreditAttribution: snowmountain commentedI 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.
Comment #4
snowmountain CreditAttribution: snowmountain commentedI 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.
Comment #5
GiorgosKsame 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
Comment #6
GiorgosKit seems with drupal 7.17
patch is no longer needed ?!!
Comment #7
zoraxFor 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
Comment #8
GiorgosKSorry 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
Comment #9
zoraxit works for me,
thank you !
Comment #10
Kourosh CreditAttribution: Kourosh commentedThe 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.
Comment #11
GiorgosKthis is not a support request
fixed on a bug report is for maintainer to assign after the patch has been applied
Comment #13
fraweg CreditAttribution: fraweg commentedHello,
At #10 I think you mean:
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
Comment #14
henrikenji CreditAttribution: henrikenji commentedRe-rolling patch against dev.
Comment #15
henrikenji CreditAttribution: henrikenji commentedComment #16
GiorgosKI will go ahead and put at RTBC
its been tried by many people before
it works with latest dev and latest 7.21 drupal
Comment #17
juanramonperez CreditAttribution: juanramonperez commented#14 works with the latest dev and drupal 7.15.
Thanks.
Comment #18
dmegatool CreditAttribution: dmegatool commented++ for the #14 patch. Works for me too.
Comment #19
fraweg CreditAttribution: fraweg commentedHello,
#14 works for me..thanks a lot!
Best regards
Frank
Comment #20
fraweg CreditAttribution: fraweg commentedHello,
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
Comment #21
IWasBornToWin CreditAttribution: IWasBornToWin commentedI assume this patch was not committed to latest dev? Just installed drupal yesterday and installed your latest dev module. Not working.
Comment #22
dbu CreditAttribution: dbu commentedi 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!
Comment #23
mlee11111 CreditAttribution: mlee11111 commentedRecreating patch for #14 as a patch file for use by our Drush make script.
Comment #24
timmarwick CreditAttribution: timmarwick commentedRe: 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
Comment #25
__cj CreditAttribution: __cj commented#23 worked for me.
Thanks.
Comment #26
parasolx CreditAttribution: parasolx commentedpatch #23 work for me.
Comment #27
rramos CreditAttribution: rramos commentedPatch #23 work for me. ;-)
Comment #28
tjtj CreditAttribution: tjtj commentedWhy isn't this patch incorporated into the distributed modules? It is totally frustrating to have to find and apply patches. Modules that break Drupal should not be distributed.
Comment #29
parasolx CreditAttribution: parasolx commentedIts already three reviewer tested the patch and it works well. No related issues waiting or block this patch form being commit.
I think is should be committed and in current -dev.
Comment #30
agileadam#23 works like a charm. Thank you!
Comment #31
Tomáš Fejfar CreditAttribution: Tomáš Fejfar commentedStill nothing. I encountered this issue today and the patch seems simple enough. What's the problem that prevents it from being merged?
Comment #32
AdamPS CreditAttribution: AdamPS commentedI intend to fix this as part of #2378869: Meta-issue for Beta 2 release. Please sign up as a follower of that issue and see the patch there that I would like feedback on.
It's effectively the same patch but I couldn't take your patch directly because there are so many issues to fix affecting the same lines of code.
Comment #33
AdamPS CreditAttribution: AdamPS commentedFix now available in latest release
Comment #34
Tomáš Fejfar CreditAttribution: Tomáš Fejfar commentedIt works for me. Thank you for resolving this so quickly.