Hi Everybody. I'm a complete newbie with Drupal and cms in general (picked Drupal as my first cms to try), so please be patient with me :)

After installing some themes and playing around a little bit, i started seeing a bunch of these lines in a pink box:

* warning: Invalid argument supplied for foreach() in /home/jonatello/public_html/includes/theme.inc on line 463.
* warning: Invalid argument supplied for foreach() in /home/jonatello/public_html/includes/theme.inc on line 468.
* warning: Invalid argument supplied for foreach() in /home/jonatello/public_html/includes/theme.inc on line 463.
* warning: Invalid argument supplied for foreach() in /home/jonatello/public_html/includes/theme.inc on line 468.
* warning: Invalid argument supplied for foreach() in /home/jonatello/public_html/includes/theme.inc on line 463.
* warning: Invalid argument supplied for foreach() in /home/jonatello/public_html/includes/theme.inc on line 468.

depending on the theme i select, the number of those lines will change. sometimes its only 2 lines, sometimes a bunch, etc.

so here's the really frustrating part for me: i looked up the warning message in the documentation and it said OSX users (which described me, so far so good) get this message and "This problem is caused by using Textmate to directly modify Drupal files on a mounted network drive." ---- --- huh? that completely does NOT describe me. I didn't do any such thing.

excuse me for ONE SECOND

*walks outside into the hall*

"i just started exploring and i'm already digging myself a hole!!"

*comes back in*

please help me?

Comments

ncameron’s picture

I was having the same problem, installing a site on an windows machine which I built on a mac. What (strangely) worked for me was flushing all the caches at /admin/settings/performance

--
Drupal Development for Pleasure and Profit
http://drupal.altate.ch

marty’s picture

Yep, this just happened to me today and flushing the caches fixed it. Seems kind of a bad feature though, wonder if this is going to be common problem.

JuliaKM’s picture

I was having the same problem upgrading my site from Drupal 5 to 6 on Dreamhost. What worked was uncommenting and setting the $base_url in settings.php.

luebbe’s picture

A fresh drupal install on xampp. Default theme Garland.

Directly after I copied one of my themes into sites/all/themes, the errors started to show up.
Cleaning the cache or setting the base_url as recommended above didn't help.

I my case the reason was a German Umlaut (ü) in the .info file which belonged to my theme.

My recommendation:
1) check for non-standard modules and themes and move them out of your installation.
2) if the error goes away check for non-ascii characters in the modules/themes files.
3) if this doesn't help check if you have non-ascii characters in the path of your installation

minus’s picture

a norwegian Ø was added to a region description. I almost got an heart attack, everything went back to normal when the Ø got replaced by an O 4 hours later.

--------------------------
http://www.mortenn.no

CanOne’s picture

cheers man...that worked for me to...stupid umlaute^^

thanks a lot

bfitzgerald’s picture

So far I have tried:
setting the base url
getting rid of any spaces in the names of the theme (there were no non standard characters)

the lines referred to in theme.inc seem to be looking for stylesheet and also the script file.

I suspect that this might be just a newbie mistake in the way I have created the template but as yet no one seems to have come up with an answer

eigentor’s picture

I had the same problem because of using the umlaut "ü" in my theme description. Having replaced it by correct writing ü everything is fine.

I created an issue for that: http://drupal.org/node/458596

Well, I closed the issue again, because the error seems to appear only in some cases. But worth a check for your at any rate.

kip stanning’s picture

hi eigentor,

your hint helped instantly. dein tipp hat sofort geholfen.
danke!

regards/lg
kip

bfitzgerald’s picture

Had this too just seemed to fix it by placing my drupal/sites/all/themes folder into a custom folder noticed this in the book pro drupal development

so the themes you create should be in drupal/sites/all/custom/themes as far as I can see.

hope this works for you.

AndrejT’s picture

I switched my theme to Garland back and the error is still there.

But the move all themes from all/themes to all/custom/themes works fine - thats the solution - really.

bfitzgerald’s picture

I was suggesting custom folder because this is what was done in book I mentioned

damn it it worked for a while or else I did something else that fixed it but either way its back now

I am getting this error only when I add my own theme. Obviously I have done something wrong with my own theme and drupal scans the sites folder when it starts and sees something wrong I have only the basic files for the theme: .info page.tpl.php I had css files in there too but they are not being used. so it might be that. I'll keep going through it if I find something I'll let you know

regards,
Bf

AndrejT’s picture

One change-

if you transfer all themes to the all/custom/themes folder than is drupal NOT able to check the updates for these themes.

Drupal 6.12 DO NOT recognise the directory /sites/all/custom/themes

wnb0540423’s picture

i have a same problem。The problem happens in the .info file
at the last of the file,we see "settings[zen_breadcrumb_separator] = ' '"
you should changed value of settings[zen_breadcrumb_separator]='>>'
i think the reason is the character do not matching

petrf’s picture

My problem was in file theme_name.info - I wrote description in native language and saved this file in code page 1250. When I saved this file in UTF-8, this problem was resolve.

marta_yo’s picture

tanks!!! I change the file .info at UTF-8 and the problem was resolve too!!!

markabur’s picture

this happened to me after making a zen subtheme. i was able to fix it by changing the character set of my info file to utf-8 (the error was related to the settings[zen...] area).

Jonathan Peterson’s picture

For me, this was caused by non-ASCII characters in the system table. Visiting admin/build/themes, making no changes, and pushing "Save Configuration" was enough for Drupal to re-write the relevant sections and solve the problem.

(I wrote up a little piece on this at http://www.ideograph.com/node/31 with a few more details if you are interested.)

Ideograph LLC
http://www.ideograph.com

jasonabc’s picture

thanks John - this worked for me ;-)

usera’s picture

this fixed the issue temporarily. drupal seems to have a problem remembering the themes in /sites/all/themes. I placed it locally and the issue has not reappeared yet.

AviadG’s picture

What worked for me is enabling one of Drupal basic themes. I enabled (didn't set to default) the Minneli theme and the error was gone.

kpastore’s picture

Not sure which one worked, but I saved settings.php as UTF-8 and enabled one default theme (Garland) and my Genesis sub-theme is now working as expected.