friebj99 Posted June 8, 2009 Share Posted June 8, 2009 After recently doing some updates to our site, I came across this problem in the back-end of our site in the Admin panel. When I go to customers and then click on a customer it doesn't retrieve the customers information from the database. This is the error that I am receiving. I have looked at the object_info.php file and its only function is to reset the array I believe. Warning: reset() [function.reset]: Passed variable is not an array or object in /home/amntajfb/public_html/strattapparel.com/admin/includes/classes/object_info.php on line 17 Warning: Variable passed to each() is not an array or object in /home/amntajfb/public_html/strattapparel.com/admin/includes/classes/object_info.php on line 18 If anyone has any insight on this problem that would be much appreciated! Thanks, Justin Link to comment Share on other sites More sharing options...
Nullachtfuffzehn Posted June 8, 2009 Share Posted June 8, 2009 There is a function call to object_info in your customers.php which didn't pass an array as expected to the function. Most likely there's a query missing or a query doesn't return an array. Link to comment Share on other sites More sharing options...
friebj99 Posted June 8, 2009 Author Share Posted June 8, 2009 I have been comparing the file with an original file. I'm not able to find any differences. I think the root of the problem may because we had transferred customer information from our old database into our new site database. I'm not sure how this could have caused this error or how to fix it. Is there a way for me to post the code other than to just copy paste it? Link to comment Share on other sites More sharing options...
Nullachtfuffzehn Posted June 8, 2009 Share Posted June 8, 2009 Was the old database from OSC too? If so, this shouldn't be the problem. Usually the function is used to create an object for customers, orders etc. which is filled by one or more database queries and then referneced for the output. In your case the object creation fails most likely because the return of the query is not an array. Check your database for empty entries. Link to comment Share on other sites More sharing options...
friebj99 Posted June 8, 2009 Author Share Posted June 8, 2009 Yes the old database was from OSC also. I couldn't find any empty entries in the customer table... Link to comment Share on other sites More sharing options...
friebj99 Posted June 9, 2009 Author Share Posted June 9, 2009 I have a feeling that it has something to do with me removing the option to select a country. I had another error before this one on line 733 in the customers.php file and had removed $country from the $customer_info array merge to get rid of that error. The previous error before I took $country out was: Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/amntajfb/public_html/strattapparel.com/admin/customers.php on line 733 Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/amntajfb/public_html/strattapparel.com/admin/customers.php on line 735 Plus the error that I am currently trying to fix. Hope this helps. Thanks, Justin PS - If someone has an original customers.php file from the admin folder so I could look at it that would be great! Link to comment Share on other sites More sharing options...
Nullachtfuffzehn Posted June 9, 2009 Share Posted June 9, 2009 Link to comment Share on other sites More sharing options...
friebj99 Posted June 9, 2009 Author Share Posted June 9, 2009 I also just noticed that in my customer_info table in the database has a bunch of NULLS. Could this possibly be affecting it from not retrieving the information from the DB? Link to comment Share on other sites More sharing options...
Nullachtfuffzehn Posted June 9, 2009 Share Posted June 9, 2009 The NULL values are usually for last login date or account last modified, so no need to worry about them. Link to comment Share on other sites More sharing options...
friebj99 Posted June 9, 2009 Author Share Posted June 9, 2009 Yeah that is where they were. When I remove $country from the array merge it gets rid of the error, so something with the country array must have been deleted. I was just looking at the customers table and there isn't even a country_id field. I have a feeling this may be the problem... Link to comment Share on other sites More sharing options...
friebj99 Posted June 9, 2009 Author Share Posted June 9, 2009 $customers_query = tep_db_query("select c.customers_id, c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city, a.entry_state, a.entry_zone_id, a.entry_country_id, c.customers_telephone, c.customers_fax, c.customers_newsletter, c.customers_default_address_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_default_address_id = a.address_book_id where a.customers_id = c.customers_id and c.customers_id = '" . (int)$HTTP_GET_VARS['cID'] . "'"); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.