Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fatal error: Call to undefined function: array_map()


nubee

Recommended Posts

hi

i just installed oscomerce 2.2 MS2 , everything seems fine till i treid to add new category and tried to add products to it , when ever i tried to add product or categories to exsiting categories i get this error

 

Fatal error: Call to undefined function: array_map() in /usr/local/plesk/apache/vhosts/dotintime.com/httpdocs/shoppe/catalog/admin/includes/functions/general.php on line 1293

 

 

can some tell why ? and how can i get rid of this ..

 

hellpppppppppppppppppppp !!

Link to comment
Share on other sites

Try pasting the following into admin/includes/functions/compatibility.php:

 

  if (!function_exists('array_map')) {

   function array_map($callback, $array) {

     if (is_array($array)) {

       $_new_array = array();

       reset($array);

       while (list($key, $value) = each($array)) {

         $_new_array[$key] = array_map($callback, $array[$key]);

       }

       return $_new_array;

     } else {

       return $callback($array);

     }

   }

 }

 

Please backup your file

Link to comment
Share on other sites

  • 2 weeks later...

Originally I was getting this error on line 1293.

 

After adding that array into compatibility.php I got this error:

 

(then when i removed the code, it works fine but I get the original fatal error only now it's on line 1295. Any ideas?)

 

Parse error : parse error in /usr/local/etc/httpd/vhosts/www.temp.com/htdocs/catalog/admin/includes/functions/compatibility.php on line 47

 

Warning : Cannot send session cache limiter - headers already sent (output started at /usr/local/etc/httpd/vhosts/www.temp.com/htdocs/catalog/admin/includes/functions/compatibility.php:47) in /usr/local/etc/httpd/vhosts/www.temp.com/htdocs/catalog/admin/includes/functions/sessions.php on line 67

 

Fatal error : Call to undefined function: array_map() in /usr/local/etc/httpd/vhosts/www.temp.com/htdocs/catalog/admin/includes/functions/general.php on line 1295

Link to comment
Share on other sites

The error that you are getting suggests that there is either extraneous white space or goofy characters in the file. Try downloading a clean version of the file, modifying it, and uploading it again (in text mode). There is no particular place that you need to put the code, but be careful not to nest it with other code. Also, it does need to be inside a <?php ?> block.

 

Hth,

Matt

Link to comment
Share on other sites

I replaced the original file and got back to the original error.

 

But everytime I try to edit the file and upload it again being carefull about any extra spaces or characters I get more errors when clicking on a category:

 

Parse error : parse error in /usr/local/etc/httpd/vhosts/www.temp.com/htdocs/catalog/admin/includes/functions/compatibility.php on line 48

 

Warning : Cannot send session cache limiter - headers already sent (output started at /usr/local/etc/httpd/vhosts/www.temp.com/htdocs/catalog/admin/includes/functions/compatibility.php:48) in /usr/local/etc/httpd/vhosts/www.temp.com/htdocs/catalog/admin/includes/functions/sessions.php on line 67

 

Fatal error : Call to undefined function: array_map() in /usr/local/etc/httpd/vhosts/www.temp.com/htdocs/catalog/admin/includes/functions/general.php on line 1293

Link to comment
Share on other sites

Be care that there are 2 compatibility.php files

The one in catalog/includes/functions/ is OK but the one in admin/includes/functions/compatibility.php missed the array_map() function. I got this trap too.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...