Zen Cart Logo
Forums / Upgrading from 1.3.x to 1.3.9 / Passed variable is not an array or object in customers after upgrading

Passed variable is not an array or object in customers after upgrading

Locked

Views: 10,036

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
8 Oct 2006, 10:25 PM
#1
royalgemsnz avatar

royalgemsnz

New Zenner

Join Date:
Apr 2006
Posts:
74
Plugin Contributions:
0

Passed variable is not an array or object in customers after upgrading

I stuffed up my db and did a fresh install and imported my old data. In my admin however, I get the below errors up top when I look at the customer details and the customer fields are blank. I can enter data but they remain blank. On the webpage side, everything seems fine. I can log in to my account and all the details are there. The version is had was 1.3.0 and now is 1.3.0.2, so im guessing something was changed in relation to this.

Does anyone know specifically what changes I need to make to fix it?

"Warning: reset(): Passed variable is not an array or object in /usr/local/psa/home/vhosts/royalgems.co.nz/httpdocs/admin/includes/classes/object_info.php on line 29

Warning: Variable passed to each() is not an array or object in /usr/local/psa/home/vhosts/royalgems.co.nz/httpdocs/admin/includes/classes/object_info.php on line 30"

8 Oct 2006, 10:55 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Passed variable is not an array or object in customers after upgrading

It would seem that perhaps your customer data-tables may not be in sync with each other. Did you encounter any errors while importing?

Tables in question are:

  • customers
  • customers_info
  • address_book
8 Oct 2006, 11:48 PM
#3
royalgemsnz avatar

royalgemsnz

New Zenner

Join Date:
Apr 2006
Posts:
74
Plugin Contributions:
0

Re: Passed variable is not an array or object in customers after upgrading

I had someone else do the import so I'm not sure. He didn't mention anything and doesn't know why the error has occured, so I'm guessing the answer is no.

Is there anyway to bring them in line with the current version?

9 Oct 2006, 12:06 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Passed variable is not an array or object in customers after upgrading

First you need to find out whether they're intact or not.

  1. How many records are there in those tables?

  2. What happens if you run this query via phpMyAdmin?
    How many records do you get?
    Do you get any errors?```
    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,
    c.customers_email_format, c.customers_group_pricing,
    c.customers_authorization, c.customers_referral
    from customers c left join address_book a
    on c.customers_default_address_id = a.address_book_id
    where a.customers_id = c.customers_id;

9 Oct 2006, 2:54 AM
#5
royalgemsnz avatar

royalgemsnz

New Zenner

Join Date:
Apr 2006
Posts:
74
Plugin Contributions:
0

Re: Passed variable is not an array or object in customers after upgrading

I ran that query and got the below error.

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '" . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a
' at line 9

From that I figure that customers and address book are the 2 tables having issues. Heres a pic of customers which has 15 rows. Address book has 13 rows

9 Oct 2006, 3:25 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Passed variable is not an array or object in customers after upgrading

oops -- I was talking to someone when I posted that query, and left some PHP code in it. I've edited it for you to try again.

9 Oct 2006, 3:26 AM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Passed variable is not an array or object in customers after upgrading

From that I figure that customers and address book are the 2 tables having issues.As I mentioned before, there are 3 tables which work in tandem:

DrByte:

It would seem that perhaps your customer data-tables may not be in sync with each other. Did you encounter any errors while importing?

Tables in question are:

  • customers
  • customers_info
  • address_book
9 Oct 2006, 3:50 AM
#8
royalgemsnz avatar

royalgemsnz

New Zenner

Join Date:
Apr 2006
Posts:
74
Plugin Contributions:
0

Re: Passed variable is not an array or object in customers after upgrading

Hmmm. I ran it again and didn't have any errors.

19 Oct 2006, 4:43 PM
#9
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,779
Plugin Contributions:
11

Re: Passed variable is not an array or object in customers after upgrading

Chris,
I'll start with the fact that I got in this mess in the middle.
Client had 4 music CDs with 2 entered as music and 2 as general. The client moved 2 generals to music by changing product type.
Cart and admin seem to work well but the two moved from general to music give the error in this thread when trying to edit in categories.
Suggestions?

21 Oct 2006, 1:07 AM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Passed variable is not an array or object in customers after upgrading

Product Types like Product General and Product Music use different database tables ...

They really are not interchangeable ...

You would need to check all the tables and make sure the proper records exist for the 2 Product General products that were manually switched to Product Music ...

21 Oct 2006, 2:06 AM
#11
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,779
Plugin Contributions:
11

Re: Passed variable is not an array or object in customers after upgrading

Thanks Linda,
I took the coward's way out and reentered the products.:smile:
But, I did go back and lock the category to music only so this won't happen again -- maybe.

21 Oct 2006, 2:09 AM
#12
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Passed variable is not an array or object in customers after upgrading

That is the best idea ...

Check your tables and make sure there are no messies left behind ... in theory deleting them should be all that is needed ...

24 Apr 2008, 4:42 PM
#13
cutterscreek avatar

cutterscreek

New Zenner

Join Date:
Mar 2008
Posts:
26
Plugin Contributions:
0

Re: Passed variable is not an array or object in customers after upgrading

My programmer had me change the object_info.php.

I changed the line after:

//this line should be added, but should be tested first:

to:

if (!is_array($object_array)) return;

Make sure you remove the "//" at the beginning of the line. This fixed this problem for me.