If this is your first visit, check our documentation. To post, register or login.
Forums / Bug Reports / Error on "Pre-add of Special"

Error on "Pre-add of Special"

Locked

Started by kotp on 6 Sep 2006, 4:56 PM · Views: 2,317

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
6 Sep 2006, 4:56 PM
#1
kotp avatar

kotp

New Zenner

Join Date:
Jun 2006
Location:
Minnesota
Posts:
38
Plugin Contributions:
0

Error on "Pre-add of Special"

Warning: reset() [function.reset]: Passed variable is not an array or object in zencartadmin/includes/classes/object_info.php on line 29

Warning: Variable passed to each() is not an array or object in zencartadmin/includes/classes/object_info.php on line 30

I got this error after updating from 1.3.0.2 to 1.3.5 while trying to Manually add new Special by Product ID.

6 Sep 2006, 5:05 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: Error on "Pre-add of Special"

kotp:

while trying to Manually add new Special by Product ID.
Huh?
Sorry ... I don't understand what you mean by "manually" and "by product ID" ...

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

6 Sep 2006, 5:50 PM
#3
kotp avatar

kotp

New Zenner

Join Date:
Jun 2006
Location:
Minnesota
Posts:
38
Plugin Contributions:
0

Re: Error on "Pre-add of Special"

DrByte:

Huh?
Sorry ... I don't understand what you mean by "manually" and "by product ID" ...

If you go to Catalog > Specials, then you can go to

You can go here to see the graphic...

click on the link on the very bottom to manually add a special.

I am getting it to fail... though not every time. Sometimes it mistakenly reports that it (the ID I supply) is already on special.

6 Sep 2006, 6:11 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: Error on "Pre-add of Special"

Oh ... right ... so many features, I forgot we had that one.

As to why it's reporting things as already on special ... it does that only if the product is already in the specials table ... which should cause it to be on the list your're looking at.

Do you have several pages of specials, such that you don't see them all on the current screen? Maybe it really "is" already set ?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

6 Sep 2006, 6:19 PM
#5
kotp avatar

kotp

New Zenner

Join Date:
Jun 2006
Location:
Minnesota
Posts:
38
Plugin Contributions:
0

Re: Error on "Pre-add of Special"

DrByte:

Oh ... right ... so many features, I forgot we had that one.

As to why it's reporting things as already on special ... it does that only if the product is already in the specials table ... which should cause it to be on the list your're looking at.

It should cause it to be on the list that I am looking at, but it doesn't, not even with a forced 'refresh'.

DrByte:

Do you have several pages of specials, such that you don't see them all on the current screen? Maybe it really "is" already set ?

No, I only have 8 products on special, trying it out, and as to why it gives the error that was quoted in the original message, I am not sure it should be doing that at all.

Also, it does seem to change something in the database, because though it isn't added the first time to the list, if I do submit the same product ID, then it does report that it is already on special, though it doesn't show in the table. At that point (the second request) it doesn't give an error, so logically in the code it is thinking it has been added.

9 Sep 2006, 3:02 AM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Error on "Pre-add of Special"

Check the $ID on the file ...
/admin/specials.php

//  $Id: specials.php 3788 2006-06-17 17:08:48Z ajeh $

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Sep 2006, 3:14 AM
#7
kotp avatar

kotp

New Zenner

Join Date:
Jun 2006
Location:
Minnesota
Posts:
38
Plugin Contributions:
0

Re: Error on "Pre-add of Special"

Ajeh:

Check the $ID on the file ...
/admin/specials.php

// $Id: specials.php 3788 2006-06-17 17:08:48Z ajeh $


Mine is ```
//  $Id: specials.php 3788 2006-06-17 17:08:48Z ajeh $
9 Sep 2006, 3:18 AM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Error on "Pre-add of Special"

Could you peek in the specials table via phpMyAdmin ...

How many products are in there? Just the 8?

Or ... you could rebuild the table with the SQL command:

DROP TABLE IF EXISTS specials;
CREATE TABLE specials (
specials_id int(11) NOT NULL auto_increment,
products_id int(11) NOT NULL default '0',
specials_new_products_price decimal(15,4) NOT NULL default '0.0000',
specials_date_added datetime default NULL,
specials_last_modified datetime default NULL,
expires_date date NOT NULL default '0001-01-01',
date_status_change datetime default NULL,
status int(1) NOT NULL default '1',
specials_date_available date NOT NULL default '0001-01-01',
PRIMARY KEY (specials_id),
KEY idx_status_zen (status),
KEY idx_products_id_zen (products_id),
KEY idx_date_avail_zen (specials_date_available),
KEY idx_expires_date_zen (expires_date)
) TYPE=MyISAM;

NOTE: this will throw out ... delete ... destroy ... all existing specials ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Sep 2006, 4:11 PM
#9
kotp avatar

kotp

New Zenner

Join Date:
Jun 2006
Location:
Minnesota
Posts:
38
Plugin Contributions:
0

Re: Error on "Pre-add of Special"

I had 10 items in there (because of the two tests mentioned before) but only 8 shows in Admin, and the store. The data from the two additions were skewed, not as I would expect.

But this problem is happening with the Featured Products as well (When I try to add manually the same way.) I think it is some common code, either shared as a function, or identical to both function files.

I would look at it, but am not proficient enough to even debug PHP.

9 Sep 2006, 4:19 PM
#10
ajeh avatar

ajeh

Oba-san

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

Re: Error on "Pre-add of Special"

What this does is a pre-add to the specials or featured table and then takes you in to edit ...

This is really designed for sites too large to just hit the New Product as that produces a dropdown of all products not on special or not featured and with 1000+ or 100000+ items the page dies ...

I have not been able to reproduce this error ...

Are you sure that you have the currenct Zen Cart v1.3.5 installed for specials.php and featured.php ...

What version of php are you running?

Is this a windows or unix server?

The only way I can reproduce this error is to enter an invalid products_id ... I will have to put in additional checks to ensure that you are protected from yourself ...

Check to see via phpMyAdmin that the specials and featured tables only contain valid products_id ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Sep 2006, 4:25 PM
#11
kotp avatar

kotp

New Zenner

Join Date:
Jun 2006
Location:
Minnesota
Posts:
38
Plugin Contributions:
0

Re: Error on "Pre-add of Special"

Ajeh:

Or ... you could rebuild the table with the SQL command:

NOTE: this will throw out ... delete ... destroy ... all existing specials ...

I will test this with the features as well, because it seems to have fixed the problem.

(I did update from 1.3.2 to 1.3.5)

I cleared the table (Which I did with the Features through the Admin > Features panel) and that seems to clear the problem up.

Thank you very much for the hint. Didn't think about clearing the table.:blush:

9 Sep 2006, 4:40 PM
#12
ajeh avatar

ajeh

Oba-san

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

Re: Error on "Pre-add of Special"

Thanks for the report ...

I will get a safety added on these that stops you from entering products_id that do not exist ... :cool:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Sep 2006, 4:57 PM
#13
kotp avatar

kotp

New Zenner

Join Date:
Jun 2006
Location:
Minnesota
Posts:
38
Plugin Contributions:
0

Re: Error on "Pre-add of Special"

I am positive that there were no items that were incorrect ID's, but still don't know what the problem was. (We cut and paste between browsers, because it avoids typographical errors.)