[support] help narrowing down cause of " array_keys() expects parameter 1 to be array" errors?

Ben DJ bendj095124367913213465 at gmail.com
Tue Jun 1 15:29:45 UTC 2010


i'm trying to troubleshoot a Drupal 6.16 site that I did not build --
so I'm not entirely clear on its install history.

if a new Page node is created -- nothing fancy, just text content -- @
nav to that page, i frequently see the following errors:

      * warning: array_keys() expects parameter 1 to be array, null
given in /srv/www/id/0323/includes/common.inc on line 1865.
      * warning: Invalid argument supplied for foreach() in
/srv/www/id/0323/includes/common.inc on line 1865.

that's frequently -- but not always.  i haven't been able to determine
what conditions cause the error to fire.

most often, simply refreshing the page makes the error disappear.

the error's rather generic -- and not reliably reproducible ...

looking @ lineno 1865 in common.inc,

-------------------------
        foreach ($css as $media => $types) {
          // If CSS preprocessing is off, we still need to output the styles.
          // Additionally, go through any remaining styles if CSS
preprocessing is on and output the non-cached ones.
          foreach ($types as $type => $files) {
            if ($type == 'module') {
              // Setup theme overrides for module styles.
              $theme_styles = array();
1865:         foreach (array_keys($css[$media]['theme']) as $theme_style) {
                $theme_styles[] = basename($theme_style);
              }
-------------------------

nothing immediately jumps out at me as to specific cause :-/

other than hunt-n-peck, how can I narrow down what's causing this?

any suggestions appreciated!

BenDJ


More information about the support mailing list