When I click to links related to orders overview (payment pending, order needing action, completed) and sales overview (monthly orders) a fatal error occor: "Fatal error: Call to undefined function: array_diff_key() in /web/htdocs/www.mysite.com/home/modules/ecommerce/store/store.module on line 1014"
Is this due to the PHP5.2 requisition?
How can I do running with 4.4.7 PHP Version?
Thank in advance.

Comments

gordon’s picture

Yes it is, You can use PHP_Compat from the pear.php.net

gordon’s picture

Priority: Critical » Normal
gordon’s picture

Status: Active » Fixed
jimmypreserve’s picture

Status: Fixed » Closed (fixed)

Thanx Gordon, it's gone without error.
Jimmy

Phillip Mc’s picture

Status: Closed (fixed) » Active

sorry guys, but, how did you fix that?

I have the same problem but don't understand what the PHP_Compat is or how to enable it in Drupal.

phil

dublin drupaller’s picture

Status: Active » Fixed

Hi Phil,

here's how I fixed it.

Paste this into the bottom of your ec_common.module.

if (!function_exists('array_diff_key')) {
    function array_diff_key() {
        $argCount   = func_num_args();
        $diff_arg_prefix = 'diffArg';
        $diff_arg_names = array();
        for ($i=0; $i < $argCount; $i++) {
            $diff_arg_names[$i] = 'diffArg'.$i;
            $$diff_arg_names[$i] = array_keys((array)func_get_arg($i));
        }
        $diffArrString = '';
        if (!empty($diff_arg_names)) $diffArrString =  '$'.implode(', $', $diff_arg_names);
        eval("\$result = array_diff(".$diffArrString.");");
        return $result;
    }
}

For other drupallers reading this...the ecommerce suite of modules needs php version 5 to run properly. therefore, if you're on php4 you need to add in some functions not available such as the above...the array_diff_key() function.

Dub

gordon’s picture

You can use the PHP_Compat library. See http://drupalecommerce.org/node/32 for information on installing this.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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