Clean install of Drupal 7 beta 1.
Installs fine, no errors or warnings.
Go to Appearance and enable the Stark theme straight after installing.
Results in the below warnings.
I have repeated this by deleting the database and all files on the server and then doing a clean install again but I get the same warnings enabling the theme.
* Warning: Invalid argument supplied for foreach() in drupal_alter() (line 931 of /home/********/drupal-7.0-beta1/includes/module.inc).
* Warning: Invalid argument supplied for foreach() in drupal_alter() (line 931 of /home/********/drupal-7.0-beta1/includes/module.inc).
* Warning: Invalid argument supplied for foreach() in drupal_alter() (line 931 of /home/********/drupal-7.0-beta1/includes/module.inc).
* Warning: Invalid argument supplied for foreach() in drupal_alter() (line 931 of /home/********/drupal-7.0-beta1/includes/module.inc).
* Warning: Invalid argument supplied for foreach() in drupal_alter() (line 931 of /home/********/drupal-7.0-beta1/includes/module.inc).
* Warning: Invalid argument supplied for foreach() in drupal_alter() (line 931 of /home/********/drupal-7.0-beta1/includes/module.inc).
* Warning: Invalid argument supplied for foreach() in drupal_alter() (line 931 of /home/********/drupal-7.0-beta1/includes/module.inc).
* Warning: Invalid argument supplied for foreach() in drupal_alter() (line 931 of /home/********/drupal-7.0-beta1/includes/module.inc).
* Warning: Invalid argument supplied for foreach() in drupal_alter() (line 931 of /home/********/drupal-7.0-beta1/includes/module.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
* Warning: Invalid argument supplied for foreach() in drupal_alter() (line 931 of /home/********/drupal-7.0-beta1/includes/module.inc).
* Warning: Invalid argument supplied for foreach() in drupal_alter() (line 931 of /home/********/drupal-7.0-beta1/includes/module.inc).
* Warning: Invalid argument supplied for foreach() in drupal_alter() (line 931 of /home/********/drupal-7.0-beta1/includes/module.inc).
* Warning: Invalid argument supplied for foreach() in drupal_alter() (line 931 of /home/********/drupal-7.0-beta1/includes/module.inc).
* Warning: Invalid argument supplied for foreach() in drupal_alter() (line 931 of /home/********/drupal-7.0-beta1/includes/module.inc).
* Warning: Invalid argument supplied for foreach() in drupal_alter() (line 931 of /home/********/drupal-7.0-beta1/includes/module.inc).
* Warning: Invalid argument supplied for foreach() in drupal_alter() (line 931 of /home/********/drupal-7.0-beta1/includes/module.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
* Warning: call_user_func_array(): First argument is expected to be a valid callback, '' was given in theme_get_registry() (line 249 of /home/********/drupal-7.0-beta1/includes/theme.inc).
Status message
The Stark theme has been enabled.
However when I repeat this with a clean install on my desktop PC using WAMP, it works fine, no warnings. So I suspect this must be an environmental issue with my shared host rather than real bugs in core code. My shared cpanel host is using
Apache 2.2.14
PHP 5.2.11
MySQL 5.0.91-community
Any ideas where to look?
Comments
FIXED
Appears to be caused by having PHP setting register_globals = On when Drupal requires it set to Off.
Normally Drupal's .htaccess file would attempt to force this setting Off in case you have it set to On.
phpinfo() reported that the master register_globals = On and Drupal's .htaccess appeared to be working because phpinfo() reported that the local register_globals = Off. However after some experimentation I found the .htaccess PHP settings weren't actually working on my shared web host.
I've discovered that my shared web host is using suPHP component as well as htscanner. This means that the .htaccess settings don't take effect due to the order in which the PHP directives are executed.
However suPHP supports per-user php.ini settings under /home/<username>/php.ini (on my web host) so creating/modifying this php.ini to set the master register_globals = Off has fixed the issue.
If I ever find any other warnings or errors showing up, the first thing I'm going to do from now on is to try and reproduce them on a local WAMP install, and check for any PHP setting differences on my shared web host's php.ini.
Absolutely correct
Thanks to Smenzo's research and helpful reply above -- and despite a few debates with the techies at the hosting company of my website -- this was exactly the problem that I had.
On its status page, my Drupal installation correctly reported that register_globals was OFF (and this is the setting in my htaccess file). But as Smenzo described above, that is the Local Value. On the other hand, I took a look at the Master Value of register_globals at admin/reports/status/php and it reported the setting as ON. It turns out that the hosting company had inadvertently placed a php.ini file in some master folder with the ON setting. They reset that to OFF and the problem was fixed.
Irritatingly, I referred them to this page when I first started troubleshooting the issue, and they ignored it until three calls later.
There are some good tips in
There are some good tips in this thread as well, specifically if using HostGator... https://www.drupal.org/node/210311