mfsumption Posted November 12, 2010 Posted November 12, 2010 I can only assume that our hosting company upgraded our version of PHP because we started getting the infamous array_merge errors on our old version of OSC that I just inherited. I found the post with the list of files to update with the "(array)" fix and I updated all the files but the two compatibility.php files since I am new to PHP and osCommerce and don't know how to fix those. Anyway, when I go to admin, then customers, and try to edit a customer, I still get the following errors: Warning: reset() [function.reset]: Passed variable is not an array or object in /home/content/06/6609606/html/store/catalog/admin/includes/classes/object_info.php on line 17 Warning: Variable passed to each() is not an array or object in /home/content/06/6609606/html/store/catalog/admin/includes/classes/object_info.php on line 18 Is this possibly related to the compatibility.php files? If yes, could someone help with how to fix those (code below)? If no, any other ideas? One other interesting happens now also, when an existing customer places an order, their shipping and billing addresses don't automatically show up - they have to click "Change Address" and then it's OK - although when checking the order later in admin, the customer's address info isn't being "copied" over to the various order related records. Assuming this is the code that needs to be fixed, but not sure - it's the only thing that matches "array_merge" Code from compatibility.php files: if (!function_exists('array_merge')) { function array_merge($array1, $array2, $array3 = '') { if ($array3 == '') $array3 = array(); while (list($key, $val) = each($array1)) $array_merged[$key] = $val; while (list($key, $val) = each($array2)) $array_merged[$key] = $val; if (sizeof($array3) > 0) while (list($key, $val) = each($array3)) $array_merged[$key] = $val; return (array)$array_merged; } }
FIMBLE Posted November 12, 2010 Posted November 12, 2010 you (or i have) would experience this if the customer does not exist in full, i.e has a username / password but no other details like address, name etc... returning Google checkout systems cause this where they create an account where none existed or the custoemr was not logged in, thats just one example there are more reasons. I go into the DB and remove the account or add the full info. Hope this helps you Nic Sometimes you're the dog and sometimes the lamp post [/url] My Contributions
mfsumption Posted November 12, 2010 Author Posted November 12, 2010 Hi Nic, Thank you for your reply. I may have inadvertently stated two separate issues in my original post, so to clarify, the "half-baked" customer scenario that you mentioned is possibly causing the object_info.php errors - or - the strange missing customer/address info issue - or - both??? I did read something similar to your reply in another thread, and I did check the `customers` table previously, but didn't see any strange records at quick glance. As an additional note, I was experimenting with adding customer accounts programmatically to the database directly (I know, that may be bad, but didn't know any other way). In my code, it would add a `customers` record and a `address_book` record and a `customer_info` record (of course I made sure the keys were populated) - did I miss any other tables? Maybe this caused my "half-baked" customer issue??? Thanks, Michael
mfsumption Posted November 15, 2010 Author Posted November 15, 2010 OK, OK, like other threads have suggested, I did finally notice some data corruption in the customers, address_book, and customers_info tables. After correcting the problems with the data, the errors went away. Phew! Thanks again folks.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.