I receive this fatal error when i try to configure Charts.

Fatal error: Call to undefined function: array_fill_keys() in /sites/all/modules/charts/charts.inc on line 103

Below are the configurations of my system:

Drupal 6.16
Drupal core update status Up to date
Module and theme update status Up to date
MySQL database 4.1.14
PHP 4.3.11
PHP memory limit 64M
PHP register globals Disabled
Web server Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.6b FrontPage/5.0.2.2510 mod_fastcgi/2.4.2

Thanks,

Comments

lcreed’s picture

I have the same issue but our webserver runs php 5.1.6 and mysql 5.0.22.

kekkis’s picture

As you can see on php.net, the function is only included in PHP 5.2 and later. However, the comments section offers a working substitute.
I will modify it a bit to show how I made my customized version work.

if (!function_exists('array_fill_keys')) {
  function array_fill_keys (array $keys, $value) {
    return array_combine($keys,array_fill(0,count($keys),$value));
  }
}

Pasting the if block into all the files that call the function did the trick neatly enough for me, although probably you could just paste it once in the .module file. Note though that this only works for PHP 5 as the functions used in the replacement require at least that.

brmassa’s picture

Guys,

its fixed. Thanks. soon on the next release.

regards,

massa

brmassa’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.