Jump to content



Latest News: (loading..)

- - - - -

array_merge error in admin

index.php object_info.php

  • Please log in to reply
4 replies to this topic

#1   brough

brough
  • Members
  • 33 posts
  • Real Name:Russell

Posted 14 July 2012 - 07:01 AM

On /catalog/admin/index.php I get the following error:

Customers: [img]http://www.motoguzzi.com.au/catalog/admin/images/pixel_trans.gif[/img] Order ID:
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in/home/motoguzz/public_html/catalog/admin/index.php on line 1211

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in/home/motoguzz/public_html/catalog/admin/index.php on line 1213

Warning: reset() [function.reset]: Passed variable is not an array or object in/home/motoguzz/public_html/catalog/admin/includes/classes/object_info.php on line 17

Warning: Variable passed to each() is not an array or object in/home/motoguzz/public_html/catalog/admin/includes/classes/object_info.php on line 18

Version is RC2A, admin is Mindsparx.

I have identical files for admin/index.php and admin/customers.php in two instalations. One works, this one has this error.

Suggestions?

#2   FWR Media

FWR Media
  • Community Sponsor
  • 6,839 posts
  • Real Name:Robert Fisher
  • Gender:Male
  • Location:Stowmarket - Suffolk - UK

Posted 14 July 2012 - 08:07 AM

You have stated that your admin is not osCommerce, it is Mindsparx.

The error is an admin error so perhaps you are asking in the wrong support forums.

The behaviour of array_merge() was changed in PHP5, it now only supports parameters of type array, so this is most probably from where the error originates.

You can force the types to array but although the error would be gone you would no doubt create problems with the merged array having incorrect data.

For example:

  $array = array( 'action' => 'index', 'controller' => 'index', 'language_code' => 'en', 'module' => 'shop', 'params' => '' );
  $array2 = '37';
  echo print_r( array_merge( (array)$array, (array)$array2 ), true );

$array2 is not an array yet this code does not produce an error as $array2 was forced to type array and given a numerical index.

It prints: -

Array ( [action] => index [controller] => index [language_code] => en [module] => shop [params] => [0] => 37 )

#3   brough

brough
  • Members
  • 33 posts
  • Real Name:Russell

Posted 14 July 2012 - 01:47 PM

Thanks Robert,

Mindsparx is a method of presenting the admin. The underlying code is, AFAIK, Oscommerce.

As I mentioned in my previous post, I have two identical installations - well, I guess they're not identical or one would not have this error

Both are on the same server using PHP5 (5.2) and the same version of MySQL.

Suggestions for a solution welcome.

#4   FWR Media

FWR Media
  • Community Sponsor
  • 6,839 posts
  • Real Name:Robert Fisher
  • Gender:Male
  • Location:Stowmarket - Suffolk - UK

Posted 14 July 2012 - 02:20 PM

With the information you have provided no one can offer you a solution other than to suggest you update your code in keeping with the requirements of PHP5.

Your sites may be on the same server with the same code but they are obviously not presenting array_merge() with the same data types.

#5   brough

brough
  • Members
  • 33 posts
  • Real Name:Russell

Posted 15 July 2012 - 05:47 AM

Thanks again, Robert. What further information do you suggest I post?