Zen Cart Logo
Forums / General Questions / Passed variable is not an array or object ... when trying to add products

Passed variable is not an array or object ... when trying to add products

Locked

Views: 3,719

Results 1 to 18 of 18
This thread is locked. New replies are disabled.
8 Dec 2008, 11:03 PM
#1
demz001 avatar

demz001

New Zenner

Join Date:
Sep 2008
Location:
Gold Coast, Australia
Posts:
56
Plugin Contributions:
0

Passed variable is not an array or object ... when trying to add products

I keep getting these warnings at the top of my zen cart admin page when I try to add more products to the store

Warning: reset() [function.reset]: Passed variable is not an array or object in /mounted-storage/home101c/sub005/sc63153-FRAS/adultworld.net.au/store/admin/includes/classes/object_info.php on line 29

Warning: Variable passed to each() is not an array or object in /mounted-storage/home101c/sub005/sc63153-FRAS/adultworld.net.au/store/admin/includes/classes/object_info.php on line 30

I am not much of a programmer, so if this has happened to anyone else, please post the solution.:no:

9 Dec 2008, 1:57 AM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,611
Plugin Contributions:
0

Re: Passed variable is not an array or object ... when trying to add products

Have you explored the posts in the Similar threads section at the bottom of this page?

9 Dec 2008, 11:45 PM
#3
demz001 avatar

demz001

New Zenner

Join Date:
Sep 2008
Location:
Gold Coast, Australia
Posts:
56
Plugin Contributions:
0

Re: Passed variable is not an array or object ... when trying to add products

ok, I went to the links you mentioned but the one about the categories was solved without a real solution. I think that person just re-uploaded their whole site from an earlier date.

My problem started when I reset the admin log. I got a warning to do so.

I went to the admin/includes/classes/object_info.php and don't understand the problem. :(

heres the code:

class objectInfo {

// class constructor
function objectInfo($object_array) {
//this line should be added, but should be tested first:
// if (!is_array($object_array)) return;
reset($object_array); <-----this is line 29
while (list($key, $value) = each($object_array)) { <-----this is line 30
$this->$key = zen_db_prepare_input($value);
}
}
}
?>

as I said before, I'm not much of a programer, I'm a graphic designer so this doesn't make much sense to me.

When I try to add a new product my browser says " information from this form will be sent in a non secure way" and then gives the option to proceed or not.

When I proceed I create a product with no image, even though I upload one through admin. No product description shows up either. Then the product shows up in the products page of the admin but its "off" by default. When turned "on" the product shows up in the store without an image, description or price (all were entered in the admin). When the product is clicked the user gets a "no product found" message.

I still need to add another couple of hundred items to the store and this could prove to be a disaster

If anyone can help, Thanks in advance.

9 Dec 2008, 11:55 PM
#4
demz001 avatar

demz001

New Zenner

Join Date:
Sep 2008
Location:
Gold Coast, Australia
Posts:
56
Plugin Contributions:
0

Re: Passed variable is not an array or object ... when trying to add products

I have just tried a test purchase and it didn't work. I keep getting the warning (as a customer) that "information from this form will be sent in a non secure way".

Now customers cannot purchase products from my store either. :(

I'm doomed !!

10 Dec 2008, 1:07 AM
#5
yellow1912 avatar

yellow1912

Totally Zenned

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

Re: Passed variable is not an array or object ... when trying to add products

// if (!is_array($object_array)) return;

Change to

if (!is_array($object_array)) return;

See if that works.

10 Dec 2008, 1:32 AM
#6
demz001 avatar

demz001

New Zenner

Join Date:
Sep 2008
Location:
Gold Coast, Australia
Posts:
56
Plugin Contributions:
0

Re: Passed variable is not an array or object ... when trying to add products

I tried this solution and it did not work. I keep getting:

"This form will be sent in a way that is not secure. Are you sure you want to send it?"

I checked out the admin/includes/configure.php and found this on lines 27 to 32:

  • If you desire your entire admin to be SSL-protected, make sure you use a "https:" URL for all 4 of the following:
    */
    define('HTTP_SERVER', 'http://myDomain.net.au');
    define('HTTPS_SERVER', 'https://myDomain.net.au');
    define('HTTP_CATALOG_SERVER', 'http://myDomain.net.au');
    define('HTTPS_CATALOG_SERVER', 'https://myDomain.net.au');

Would I change it to?

define('HTTP_SERVER', 'https://myDomain.net.au');
define('HTTPS_SERVER', 'https://myDomain.net.au');
define('HTTP_CATALOG_SERVER', 'https://myDomain.net.au');
define('HTTPS_CATALOG_SERVER', 'https://myDomain.net.au');

10 Dec 2008, 3:35 AM
#7
demz001 avatar

demz001

New Zenner

Join Date:
Sep 2008
Location:
Gold Coast, Australia
Posts:
56
Plugin Contributions:
0

Re: Passed variable is not an array or object ... when trying to add products

This did not work either

10 Dec 2008, 3:55 AM
#8
drbyte avatar

drbyte

Sensei

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

Re: Passed variable is not an array or object ... when trying to add products

What version of Zen Cart? Has it been upgraded ever? From what version(s)?
What addons have you installed?
How has your site been customized, compared to a brand new clean fresh install?
How have you altered the database tables, if at all?
Have you done any bulk loading using various addon/external tools? Which ones?

10 Dec 2008, 4:09 AM
#9
demz001 avatar

demz001

New Zenner

Join Date:
Sep 2008
Location:
Gold Coast, Australia
Posts:
56
Plugin Contributions:
0

Re: Passed variable is not an array or object ... when trying to add products

The version is 1.3.8

I have installed the "newsletter subscriber mod" and the "blank sidebox mod"(this was made by me, following a tutorial), and thats it.

The "newsletter subsciber mod" did add an extra table to my database.

As yet I have not been able to install "easy populate", or any other mass upload program. I've had extreme difficulty with this, it would make it easier to add the extra couple of hundred products I still have to add but can't now because of this problem.

I am using the "theme 113" template from template monster. I have modified its css a fair bit, so it looks quite different to the original.

Again, this problem started when I reset my admin log. I only did this because I got a warning to do so. Before this I backed up my database.

10 Dec 2008, 4:14 AM
#10
yellow1912 avatar

yellow1912

Totally Zenned

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

Re: Passed variable is not an array or object ... when trying to add products

TM templates do NOT work with zencart. Period.

10 Dec 2008, 4:17 AM
#11
drbyte avatar

drbyte

Sensei

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

Re: Passed variable is not an array or object ... when trying to add products

demz001:

Again, this problem started when I reset my admin log. I only did this because I got a warning to do so.
Clearing the admin activity log only clears out the history of clicks made by admin users in your store. It has nothing whatsoever to do with data used to create products.

10 Dec 2008, 4:19 AM
#12
drbyte avatar

drbyte

Sensei

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

Re: Passed variable is not an array or object ... when trying to add products

demz001:

As yet I have not been able to install "easy populate", or any other mass upload program. I've had extreme difficulty with this, ...
So, does that mean you have installed EP and tried to use it, but ran into problems and it didn't load data the way you hoped it would?
Thus, it's possible that maybe it has loaded bad data into your database? That could certainly contribute to the symptoms you're reporting.

10 Dec 2008, 4:37 AM
#13
demz001 avatar

demz001

New Zenner

Join Date:
Sep 2008
Location:
Gold Coast, Australia
Posts:
56
Plugin Contributions:
0

Re: Passed variable is not an array or object ... when trying to add products

The whole thing was working fine... for about 3 weeks until the admin log became full, when I reset the admin log the problem started.

What is your suggestion? Do I start again ?!? with another template ??

What do you think Dr.Byte?

10 Dec 2008, 4:47 AM
#14
demz001 avatar

demz001

New Zenner

Join Date:
Sep 2008
Location:
Gold Coast, Australia
Posts:
56
Plugin Contributions:
0

Re: Passed variable is not an array or object ... when trying to add products

Sorry, my last post was answering an earlier post by someone else on this thread.... I hadn't cleared my cache or reloaded the page.

To answer you Dr.Byte, I did try to install EP but when I did, I could not access the site at all and my entire site didn't work. So I deleted all EP files. I just re-checked and am sure I have deleted them all. The whole EP thing was done and deleted early on... before I installed the other mods.

I don't want to have to start again :(

10 Dec 2008, 5:00 AM
#15
demz001 avatar

demz001

New Zenner

Join Date:
Sep 2008
Location:
Gold Coast, Australia
Posts:
56
Plugin Contributions:
0

Re: Passed variable is not an array or object ... when trying to add products

What does it mean when it says:

"This form will be sent in a way that is not secure. Are you sure you want to send it?" (this is from Safari)

or

"Although this page is encrypted, the information you have entered is to be sent over an unencrypted connection and could easily be read by a third party.

Are you sure you want to continue sending this information?" (this is from Firefox)

10 Dec 2008, 5:41 AM
#16
demz001 avatar

demz001

New Zenner

Join Date:
Sep 2008
Location:
Gold Coast, Australia
Posts:
56
Plugin Contributions:
0

Re: Passed variable is not an array or object ... when trying to add products

I checked out the admin/includes/configure.php and found this on lines 27 to 32:

  • If you desire your entire admin to be SSL-protected, make sure you use a "https:" URL for all 4 of the following:
    */
    define('HTTP_SERVER', 'http://myDomain.net.au');
    define('HTTPS_SERVER', 'https://myDomain.net.au');
    define('HTTP_CATALOG_SERVER', 'http://myDomain.net.au');
    define('HTTPS_CATALOG_SERVER', 'https://myDomain.net.au');

I changed it to it to

define('HTTP_SERVER', 'https://myDomain.net.au');
define('HTTPS_SERVER', 'https://myDomain.net.au');
define('HTTP_CATALOG_SERVER', 'https://myDomain.net.au');
define('HTTPS_CATALOG_SERVER', 'https://myDomain.net.au');

after I did this I was able to add another product to my store. Another really cool thing was that I could purchase the new product. :)

Part of the original problem still exists though, I cannot modify any previously uploaded products in the admin, when I do, the product disappears from the admin and the store.
Also, I still cannot purchase any of the products that were entered into the store previously. Whenever I press the add to cart button I get "your shopping cart is empty".

Does this mean I should delete all products and start again?

10 Dec 2008, 11:36 PM
#17
demz001 avatar

demz001

New Zenner

Join Date:
Sep 2008
Location:
Gold Coast, Australia
Posts:
56
Plugin Contributions:
0

Re: Passed variable is not an array or object ... when trying to add products

heres the popup I get when I press "add to cart"

Then I end up here... with my shopping cart empty.

If anybody can help it would be much appreciated. Thanks

11 Dec 2008, 5:46 AM
#18
demz001 avatar

demz001

New Zenner

Join Date:
Sep 2008
Location:
Gold Coast, Australia
Posts:
56
Plugin Contributions:
0

Re: Passed variable is not an array or object ... when trying to add products

I think the problem lies with my hosting company... I just did a second install of zen cart in another directory of my webroot and found that I get the same warnings. I'm with servage.net and so far they cannot help me. They have also had quite a few database server crashes, which doesn't help.

I am now migrating to hostgator.com, who have guaranteed me this wont happen with them. I will do this tonight... so if anyone has any other advice, or opinion about hostgator.com before I do this, please post it.