Hi,
Our website: www.jesper-holm.dk has been up and running for a few months now, and all of a sudden, there is a warning: Invalid argument supplied for foreach() in /home/jesperholm.demo01.nli.dk/www/modules/imce/imce.module on line 167.
It should be said that:
*We are using drupal 6.0
*The website is actually www.jesper-holm.dk and not jesperholm.demo01.nli.dk as shown in the error string above(this was the first test of the site before we moved everything over, yet the error message is relating back to the old site name). I'm not sure if this has something to do with the problem, and I don't know where it is finding this information to change it.
*Here is the code surrounding the line mentioned:
166 $roles_profiles = variable_get('imce_roles_profiles', array());
167 foreach ($user->roles as $rid => $name) {
168 if (isset($roles_profiles[$rid]['pid']) && $roles_profiles[$rid]['pid']) {
169 return TRUE;
170 }
After running update.php I also get these following errors:
warning: array_fill() [function.array-fill]: Number of elements must be positive in /home/jesperholm.demo01.nli.dk/www/includes/database.inc on line 241.
warning: implode() [function.implode]: Bad arguments. in /home/jesperholm.demo01.nli.dk/www/includes/database.inc on line 241.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home/jesperholm.demo01.nli.dk/www/modules/user/user.module on line 502.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT p.perm FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /home/jesperholm.demo01.nli.dk/www/modules/user/user.module on line 502.
Again, they all point to this outdated site name. Can anyone help?
Mark
Comments
Comment #1
ufku commentedBeing not related to IMCE, the problem seems to be related to the users_roles table in db. It might have been truncated. That may be the reason for the user object having no roles associated.
Comment #2
jesperholm commentedHow would one rectify the problem? It is not the only warning I get, but I think that they are all related:
warning: array_fill() [function.array-fill]: Number of elements must be positive in /home/jesperholm.demo01.nli.dk/www/includes/database.inc on line 241.
warning: implode() [function.implode]: Bad arguments. in /home/jesperholm.demo01.nli.dk/www/includes/database.inc on line 241.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home/jesperholm.demo01.nli.dk/www/modules/user/user.module on line 502.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT p.perm FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /home/jesperholm.demo01.nli.dk/www/modules/user/user.module on line 502.
Account: '1'
I need help bigtime! The first warning seems to go away after a few times of updateing php and running cron, but they always come back. It could also be good if I could at least hide the warnings from the users, but be shown to the admin, but I can't seem to find anything on any forums. Is it possible?
Comment #3
ufku commentedTry disabling user related(extending or altering users such as profile) modules one by one.
Try replacing your drupal files & folders with the new ones.
You can disable error reporting to the screen at admin/settings/error-reporting
Comment #4
kenorb commentedThis could be related as well to wrong parameters in 'access callback'.
See: http://drupal.org/node/368584