Oscommerce issues after Upgrade PHP 5.3

After upgrading an OsCommerce site to PHP5 (5.3+ version) the follow errors occurred when using the customer part of the admin section:

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /catalog/admin/customers.php on line 782
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /catalog/admin/customers.php on line 784

To eliminate the array_merge() errors, edit the admin/customers.php file:

Find these lines:

$customer_info = array_merge($country, $info, $reviews); 
$cInfo_array = array_merge($customers, $customer_info);

and change them to:

$customer_info = array_merge((array)$country, (array)$info, (array)$reviews); $cInfo_array = array_merge((array)$customers, (array)$customer_info);

How tu debug in php warnings & errors

// Set the level of error reporting

 error_reporting(E_ALL & ~E_NOTICE);
//error_reporting(E_ALL);
//ini_set("display_errors", 1);

see also : http://php.net/manual/fr/errorfunc.configuration.php

PHP variables for 5.3 to use instead HTTP_ versions

// >>> BEGIN REGISTER_GLOBALS
  if (version_compare(phpversion(), "4.1.0", ">") === true) {
    $HTTP_GET_VARS = $_GET;
    $HTTP_POST_VARS = $_POST;
    $HTTP_SERVER_VARS = $_SERVER;
    $HTTP_POST_FILES = $_FILES;
    $HTTP_ENV_VARS = $_ENV;
    if (isset($_COOKIE)) $HTTP_COOKIE_VARS = $_COOKIE;
  }
// <<< END REGISTER_GLOBALS

Cheers

extradrmtech

Since 30 years I work on Database Architecture and data migration protocols. I am also a consultant in Web content management solutions and medias protecting solutions. I am experienced web-developer with over 10 years developing PHP/MySQL, C#, VB.Net applications ranging from simple web sites to extensive web-based business applications. Besides my work, I like to work freelance only on some wordpress projects because it is relaxing and delightful CMS for me. When not working, I like to dance salsa and swing and to have fun with my little family.

You may also like...

Leave a Reply