By PatrickAlessi on
My site shows this message:
warning: Invalid argument supplied for foreach() in /mounted-storage/home82b/sub001/sc27388-RXTT/dq.dk/includes/theme.inc on line 485.
warning: Invalid argument supplied for foreach() in /mounted-storage/home82b/sub001/sc27388-RXTT/dq.dk/includes/theme.inc on line 490.
Whats wrong?
Comments
Hey Patrick, This is tough to
Hey Patrick,
This is tough to answer, since these kinds of errors are usually triggered by something that was recently added to your site, not by the code that the errors actually point to. When did the errors start and what happened right before they did?
That being said, these two errors in particular point to problems in your theme's .info file with missing/incorrect info['stylesheet'] and info['script'] lines. You might want to start by checking that you don't have something like:
info['stylesheet'] =
or
info['script'] =
(nothing after the equals sign) in your .info file.
The lines in the theme.inc
The lines in the theme.inc looks like this:
485: foreach ($theme->info['stylesheets'] as $media => $stylesheets) {
490: foreach ($theme->info['scripts'] as $script => $path) {
I don't know anything aboub php so i can't determine if there is a problem.
Another thing is: When i update og edit a page i get this message:
warning: Invalid argument supplied for foreach() in /mounted-storage/home82b/sub001/sc27388-RXTT/dq.dk/includes/theme.inc on line 485.
warning: Invalid argument supplied for foreach() in /mounted-storage/home82b/sub001/sc27388-RXTT/dq.dk/includes/theme.inc on line 490.
warning: Invalid argument supplied for foreach() in /mounted-storage/home82b/sub001/sc27388-RXTT/dq.dk/includes/theme.inc on line 485.
warning: Invalid argument supplied for foreach() in /mounted-storage/home82b/sub001/sc27388-RXTT/dq.dk/includes/theme.inc on line 490.
Looks like i get 2 identical messages.
I don't remember what triggered the problem... Maybe i just ran a manual cron?
Afterwords i went trhoug and abudated the different modules and the drupal cure to 6.17 (overwriting the files via ftp.)
I really need some help
Turns out i just had to delete a unused theme from "sites/all/themes" and the problem was gone.
It seems the actual cause of
It seems the actual cause of this might be the use of non-ASCII characters in the .info-file in combination with encoding the file in something other than UTF-8.
In my case, I narrowed it down to using Danish vowels ("æøå") in some of the key-value pairs in the .info file of my custom theme. I then saved the file using ISO-8859-1 (or ANSI) and this maked Drupal choke on the file. Each theme I had enabled (e.g. a seperate admin theme) caused a new set of warnings to appear, so that's why some people report seeing this error twice or more on their site. This was true even if I disabled the offending theme.
Saving the .info-file as UTF-8 removed the warnings for me.
Hope this helps someone.
Cheers,
Achton
You are my hero
OMG Thanks for this tip, just saved my life. Thumbs up (y)
Not an encoding issue
http://drupal.org/node/854268#comment-3431548