Forums / General Questions / array_merge error on ported OSC database

array_merge error on ported OSC database

Locked
Results 1 to 13 of 13
This thread is locked. New replies are disabled.
10 Nov 2008, 15:34
#1
edadk avatar

edadk

Zen Follower

Join Date:
Nov 2008
Posts:
191
Plugin Contributions:
0

array_merge error on ported OSC database

Hi,

I've now been working with ZenCart for a couple of days and am very happy with everything so far. I'm porting my store over from a 2002 version of OSCommerce and things are progressing nicely.

However, I'm getting an error when viewing the customer list and could use some help resolving the error.

Error Messages:

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/.hadrondryer/afterhrs/zencart.mainlyminis.net/admin/customers.php on line 1099

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/.hadrondryer/afterhrs/zencart.mainlyminis.net/admin/customers.php on line 1101

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/.hadrondryer/afterhrs/zencart.mainlyminis.net/admin/includes/classes/object_info.php on line 29

Warning: Variable passed to each() is not an array or object in /home/.hadrondryer/afterhrs/zencart.mainlyminis.net/admin/includes/classes/object_info.php on line 30


The first 2 errors are generated from these 2 lines in admin/customers.php

$customer_info = array_merge($country->fields, $info->fields, $reviews->fields);

$cInfo_array = array_merge($customers->fields, $customer_info);


The customer list displays ok beneath the errors, but I can't select a customer for editing.

Can someone tell me what these statements are looking for that must be missing in my imported database?

Also, I'd just like to say thanks to the developers for creating such an excellent product, it's far superior to my old version. Most of the mods I made in OSC are now standard features so rebuilding my store in ZenCart hasn't been too difficult so far.

In the last 2 days I've ported the database, re-created the look and feel of my old store by creating a custom template, and managed to import over 6,000 products and 6,000 customers without too many major issues so far.

It's really refreshing to be able to make so many modifications without having to touch the core code, which means version upgrades will be possible for me now. This was a huge problem in the past and now it won't even be an issue.

Thanks in advance for any assistance.

Ed
10 Nov 2008, 19:43
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: array_merge error on ported OSC database

edadk:


Can someone tell me what these statements are looking for that must be missing in my imported database?

It's looking for data in the "customers", "customers_info", "address_book", and "reviews" tables, based on the customers_id of the selected customer.
10 Nov 2008, 21:18
#3
edadk avatar

edadk

Zen Follower

Join Date:
Nov 2008
Posts:
191
Plugin Contributions:
0

Re: array_merge error on ported OSC database

Thanks, that helps a lot.

But it means I still have a lot of work to do!

Ed
10 Nov 2008, 21:34
#4
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: array_merge error on ported OSC database

There is also an module in the free addon to help you porting database from osc to zen, just in case you dont know about it.
10 Nov 2008, 22:10
#5
edadk avatar

edadk

Zen Follower

Join Date:
Nov 2008
Posts:
191
Plugin Contributions:
0

Re: array_merge error on ported OSC database

yellow1912:

There is also an module in the free addon to help you porting database from osc to zen, just in case you dont know about it.


Yes, that's what I used to get this far. Without it I couldn't even start this project.

Ed
12 Nov 2008, 00:01
#6
jandc avatar

jandc

New Zenner

Join Date:
Nov 2008
Posts:
16
Plugin Contributions:
0

Re: array_merge error on ported OSC database

DrByte:

It's looking for data in the "customers", "customers_info", "address_book", and "reviews" tables, based on the customers_id of the selected customer.



i'm experiencing this problem currently but because of different causes.

today, i uploaded a series of customers from a software my client had in their "shop." about 5200.

do all the fields need to be completely filled in for the database to operate properly? that is, is it possible that the lack of data in the "customers_info" will be filled out when users access and update their accounts? do the country_id and zone_id need to be filled out?

why is the system querying "reviews" in such a way that reviews seem (to me) to be required? that is, wouldn't the customer_id fill into the reviews once a review is actually created?

i wrote a few quick scripts for imputing most of the data that was missing (such as selecting HTML for the newsletter rather than text); is this the best way to fix the missing data in my client's zencart db? if so, can you provide any direction on what information needs to be in there so i don't miss anything?

thank you so much in advance!! :huh:
12 Nov 2008, 00:31
#7
edadk avatar

edadk

Zen Follower

Join Date:
Nov 2008
Posts:
191
Plugin Contributions:
0

Re: array_merge error on ported OSC database

Just add a new customer and you'll see how ZenCart fills in the fields. That helped me a lot.

The field that gave me the most trouble was customers default address id, if the right value isn't in the record, you'll have problems later.

You could also set up another ZenCart and load the sample data that will help illustrate how things are stored and linked.

Hope this helps a little.

Ed
12 Nov 2008, 14:53
#8
jandc avatar

jandc

New Zenner

Join Date:
Nov 2008
Posts:
16
Plugin Contributions:
0

Re: array_merge error on ported OSC database

i'll see what i can figure out; thanks. :)
12 Nov 2008, 15:24
#9
jandc avatar

jandc

New Zenner

Join Date:
Nov 2008
Posts:
16
Plugin Contributions:
0

Re: array_merge error on ported OSC database

so i'm not seeing anything that's crucial here.

nothing loads to the reviews. only thing my db is missing is the customer_info_id (which is only marginally useful, imho) and the zones...pretty simple fixes.

any idea if this is "business critical"? i'd rather prioritize this lower if it's not that important for the functioning of the shopping cart...
12 Nov 2008, 15:50
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: array_merge error on ported OSC database

What version of Zen Cart are you using?
A bandage was added in 1.3.8 to auto-generate the customers_info record when people did incorrect imports of data.

It would be best to generate the customers_info record while building customer data. The system does expect it to be intact.

In terms of your comment about "marginally useful", you're marginally correct. :blush: Without that record, you'll probably get errors during login, or at least the login stats for your customer will be lost.

The upcoming v1.4 version of Zen Cart expects the customers_info data to be intact during the upgrade while it merges the 2 tables into one, essentially minimizing the problem you're complaining about.
12 Nov 2008, 16:29
#11
jandc avatar

jandc

New Zenner

Join Date:
Nov 2008
Posts:
16
Plugin Contributions:
0

Re: array_merge error on ported OSC database

didn't mean to step on any toes there; i'm using 1.3.8

i ended up just uploading the zone_id's and country_id'ss and the array_merge error is gone.

because i'd rather avoid any possible complications (which you seem to imply, dr. byte), i'll fix the customer_info_id. that id is suppose to match the customer_id, correct? it's a 1-to-1 relationship?

thx for all your help so far! :bigups:
12 Nov 2008, 22:14
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: array_merge error on ported OSC database

Yes, customers.customers_id is a one-to-one relationship with customers_info.customers_info_id
14 Nov 2008, 00:18
#13
jandc avatar

jandc

New Zenner

Join Date:
Nov 2008
Posts:
16
Plugin Contributions:
0

Re: array_merge error on ported OSC database

awesome; thanks Dr. Byte. :D