{"id":10417,"date":"2011-09-27T05:15:47","date_gmt":"2011-09-27T09:15:47","guid":{"rendered":"http:\/\/info.template-help.com\/?p=10417"},"modified":"2013-02-12T11:33:37","modified_gmt":"2013-02-12T16:33:37","slug":"oscommerce-warning-array_merge-error-fix","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/oscommerce-warning-array_merge-error-fix.html","title":{"rendered":"osCommerce Warning: array_merge() error fix"},"content":{"rendered":"<p>This tutorial will show you  how to fix the following warning at your admin panel:\r\n  <strong>Warning: array_merge()&#8230;<\/strong> It usually looks like: <\/p>\r\n\r\n<a href=\"http:\/\/info.template-help.com\/wp-content\/uploads\/2011\/09\/osc-array-merge-error-1.jpg\"><img loading=\"lazy\" src=\"http:\/\/info.template-help.com\/wp-content\/uploads\/2011\/09\/osc-array-merge-error-1-300x83.jpg\" alt=\"\" title=\"osc-array-merge-error-1\" width=\"300\" height=\"83\" class=\"aligncenter size-medium wp-image-10418\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/09\/osc-array-merge-error-1-300x83.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/09\/osc-array-merge-error-1-1024x285.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/09\/osc-array-merge-error-1.jpg 1104w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\r\n<p>1. First of all, you need to look at the file mentioned file in the  warning message. As you can see in the example it is:<\/p>\r\n<p><strong>\/home\/mgreen\/public_html\/adrian\/osc\/admin\/customers.php<\/strong><\/p>\r\n<p>Open the mentioned file and find the following text (there can be several  lines with this text):<\/p>\r\n<pre class=\"brush:php\">array_merge()<\/pre>\r\n\r\n<p> In the example file <strong>customers.php<\/strong> you will find the following  code:<\/p>\r\n\r\n<pre class=\"brush:php\">\r\n\t$customer_info = array_merge($country, $info, $reviews);\r\n\t$cInfo_array = array_merge($customers, $customer_info);\r\n<\/pre>\r\n\r\n<p>2. You need to update all the code with <strong>array_merge.<\/strong> Add (array) text before each of $ symbols.  So, it should become:<\/p>\r\n\r\n<pre class=\"brush:php\">\r\n\t$customer_info = array_merge((array)$country, (array)$info, (array)$reviews);\r\n\t$cInfo_array = array_merge((array)$customers, (array)$customer_info);\r\n<\/pre>\r\n    \r\n  <p>You should do the same for all code with <strong>array_merge.<\/strong><\/p>\r\n  \r\n<p class=\"attention\">Note: The behaviour of <strong>array_merge()<\/strong> was modified in PHP 5.  Unlike PHP 4, <strong>array_merge()<\/strong> now only accepts parameters of type array. However, you can use typecasting to merge  other types.<\/p>\r\n\r\n<p>3. Here is the list of files which should be edited in such cases:<\/p>\r\n\r\n<p>\r\n\r\n\r\n<ul class=\"files-structure\">\r\n\t<li class=\"lev-1\"><strong>\/catalog\/admin\/<\/strong><\/li>\r\n\t<li class=\"file lev-2\"><strong>banner_manager.php<\/strong><\/li>\r\n\t<li class=\"file lev-2\"><strong>categories.php<\/strong><\/li>\r\n\t<li class=\"file lev-2\"><strong>configuration.php<\/strong><\/li>\r\n\t<li class=\"file lev-2\"><strong>customers.php<\/strong><\/li>\r\n\t<li class=\"file lev-2\"><strong>manufacturers.php<\/strong><\/li>\r\n\t<li class=\"file lev-2\"><strong>orders.php<\/strong><\/li>\r\n\t<li class=\"file lev-2\"><strong>orders_status.php<\/strong><\/li>\r\n\t<li class=\"file lev-2\"><strong>reviews.php<\/strong><\/li>\r\n\t<li class=\"file lev-2\"><strong>specials.php<\/strong><\/li>\r\n<\/ul>\r\n\r\n<ul class=\"files-structure\">\r\n\t<li class=\"lev-1\"><strong>\/catalog\/admin\/includes\/clases\/<\/strong><\/li>\r\n\t<li class=\"file lev-2\"><strong>emails.php<\/strong><\/li>\r\n<\/ul>\r\n\r\n<ul class=\"files-structure\">\r\n\t<li class=\"lev-1\"><strong>\/catalog\/admin\/includes\/functions\/<\/strong><\/li>\r\n\t<li class=\"file lev-2\"><strong>compatibility.php<\/strong><\/li>\r\n    <li class=\"file lev-2\"><strong>general.php<\/strong><\/li>\r\n<\/ul>\r\n\r\n<ul class=\"files-structure\">\r\n\t<li class=\"lev-1\"><strong>\/catalog\/includes\/clases\/<\/strong><\/li>\r\n\t<li class=\"file lev-2\"><strong>emails.php<\/strong><\/li>\r\n    <li class=\"file lev-2\"><strong>http_client.php<\/strong><\/li>\r\n<\/ul>\r\n\r\n<ul class=\"files-structure\">\r\n\t<li class=\"lev-1\"><strong>\/catalog\/includes\/functions\/<\/strong><\/li>\r\n\t<li class=\"file lev-2\"><strong>compatibility.php<\/strong><\/li>\r\n<\/ul>\r\n\r\n<ul class=\"files-structure\">\r\n\t<li class=\"lev-1\"><strong>\/catalog\/includes\/modules\/payment\/<\/strong><\/li>\r\n\t<li class=\"file lev-2\"><strong>paypal_uk_direct.php<\/strong><\/li>\r\n    <li class=\"file lev-2\"><strong>paypal_uk_express.php<\/strong><\/li>\r\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>This tutorial will show you how to fix the following warning at your admin panel: Warning: array_merge()&#8230; It usually looks like: 1. First of all, you need to look at the file mentioned file in the warning message. As you can see in the example it is: \/home\/mgreen\/public_html\/adrian\/osc\/admin\/customers.php Open the mentioned file and find the [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":10419,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[731],"tags":[1064,538],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/10417"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=10417"}],"version-history":[{"count":0,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/10417\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/10419"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=10417"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=10417"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=10417"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}