You may have just recovered from a ‘White screen of death’ and having now activated PHP’s error reporting as in my blog posting here.

Now that you have found what the error is: (mine specifically was)

* warning: Invalid argument supplied for foreach() in /htdocs/mythemename/sites/all/themes/mythemename/template.php on line xxx.

(xxx could be pretty much any line number depending on your template)

I found the fix on a lullabot node on the Drupal site, but it did take some digging to find and so even if it’s just for my own reference I’m adding the solution here so when I build my next Drupal website I’ll at least have a record of – and solution to all the problems I came across developing a Drupal site.

Find the template.php file in sites/all/themes/mythemename and look for the code:

if ($object->uid && $object->name) {

And then change it to this:

if ($object->uid && $object->name && module_exists(‘profile’)) {

It works like a charm, refresh your page and boom! Error gone.


XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>