Hello, I get this error message anytime I set any permission(s) on my site. I have updated all the necessary modules and my drupal installation is up to date.
"
Warning: Invalid argument supplied for foreach() in user_permission_get_modules() (line 3040 of /home/mysite/public_html/modules/user/user.module).
Warning: Invalid argument supplied for foreach() in user_permission_get_modules() (line 3040 of /home/mysite/public_html/modules/user/user.module).
Warning: Invalid argument supplied for foreach() in user_permission_get_modules() (line 3040 of /home/mysite/public_html/modules/user/user.module).
Warning: Invalid argument supplied for foreach() in user_permission_get_modules() (line 3040 of /home/mysite/public_html/modules/user/user.module).
"
I'll appreciate a solution from anyone concerning this issue,
Thanks in advance
Comments
Comment #1
pixelsweatshop CreditAttribution: pixelsweatshop commentedA quick google search for:
Warning: Invalid argument supplied for foreach() in user_permission_get_modules() (line 3040 of /modules/user/user.module).
results in a number of people with the same issue.
Have you tried any of them?
Comment #2
deeray CreditAttribution: deeray commentedYes I have done a google search on this, but none of codes looked liked what I saw when I opened up my user.module file.
Please bear with me, I don't have any coding experience, I hope am reporting this correctly,
This is what I got on my user.module file from Line 3036 - line 3045,
"function user_permission_get_modules() {
$permissions = array();
foreach (module_implements('permission') as $module) {
$perms = module_invoke($module, 'permission');
foreach ($perms as $key => $value) {
$permissions[$key] = $module;
}
}
return $permissions;
}"
what can I edit in this code to resolve the issue?
Thanks in advance for your help.
Comment #3
pixelsweatshop CreditAttribution: pixelsweatshop commentedDon't touch core. The problem is most likely one of your installed contrib modules
Comment #4
deeray CreditAttribution: deeray commentedI have over 300 installed contrib modules on my site, how do I figure out which is generating the problem?
Comment #5
deeray CreditAttribution: deeray commentedI have over 300 installed contrib modules on my site, how do I figure out which is generating the problem? I have also had my site host perform a malware scan on the site and they found nothing.
What other information may you need to help me get to the solution?
Comment #6
pixelsweatshop CreditAttribution: pixelsweatshop commented300 is a lot. Even for a large site. I would start by identifying which modules interact with the user API and start disabling one by one and testing each tine to see if the error persists. Also what else does dblog say?
Comment #7
deeray CreditAttribution: deeray commentedI have disabled all the user related modules I know, but the problem still persists... and I must mention that this error message also pops up sometimes when I delete a module
"An illegal choice has been detected. Please contact the site administrator"
It has really been a challenge mainly because I don't even know what I'm looking for or where to look.
Is it okay for me to just 'ignore' these error messages?
Comment #8
deeray CreditAttribution: deeray commentedHello,
I just had my sites hosting provider restore my "public_html/sites/all" folder to Feb 25th, that is One month ago, but I'm sorry to say the problem persists.
I need some help please,
thanks in advance
Comment #9
pixelsweatshop CreditAttribution: pixelsweatshop commentedWhat does it say in dblog and server error logs
Comment #10
deeray CreditAttribution: deeray commentedI'm inexperienced with drupal, I did a search concerning your last comment and it appears 'dblog' is a module and I need a special module to check my server error logs, but I was unable to find any links to download and install them
Comment #11
pixelsweatshop CreditAttribution: pixelsweatshop commentedTry setting your permissions to trigger the error, then go to /admin/reports/dblog and copy and paste the errors and details
Comment #12
flocondetoile@deeray.
I met same error messages.
Ii was because some custom modules have implemented hook_permission() but without returning anything.
For debug, you can add in user.module (remove it after) this snippet to see wich module implement this empty permission
You will see then which module is the guilty.
Comment #13
ZalemCitizen CreditAttribution: ZalemCitizen commented@flocondetoile
Thanks to point it out !
#12 made the trick
Comment #14
cilefen CreditAttribution: cilefen commented