Zen Cart Logo
Forums / All Other Contributions/Addons / Easy Popluate and Stocks By Attribute Error

Easy Popluate and Stocks By Attribute Error

Views: 1,617

Results 1 to 10 of 10
27 Feb 2010, 6:40 PM
#1
hgrubb avatar

hgrubb

New Zenner

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

Easy Popluate and Stocks By Attribute Error

I am using a fresh install of Zen Cart 1.3.8. I installed Easy Populate and Stocks By Attribute and both worked fine. I then downloaded and installed the Easy Populate and Stocks by Attribute contribution which is only a new easypopulate.php file for the admin folder. When I go to Tools -> Easy Populate and click on "Download Model/Price/Qty/Pwas .csv file to edit" I get the following error:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/content/h/s/s/***/html/admin/easypopulate.php on line 803

Warning: Cannot modify header information - headers already sent by (output started at /home/content/h/s/s//html/admin/easypopulate.php:803) in /home/content/h/s/s//html/admin/easypopulate.php on line 1149

Warning: Cannot modify header information - headers already sent by (output started at /home/content/h/s/s//html/admin/easypopulate.php:803) in /home/content/h/s/s//html/admin/easypopulate.php on line 1150

Warning: Cannot modify header information - headers already sent by (output started at /home/content/h/s/s//html/admin/easypopulate.php:803) in /home/content/h/s/s//html/admin/easypopulate.php on line 1154

Warning: Cannot modify header information - headers already sent by (output started at /home/content/h/s/s//html/admin/easypopulate.php:803) in /home/content/h/s/s//html/admin/easypopulate.php on line 1158
v_products_model,v_specials_price,v_specials_date_avail,v_specials_expires_date,v_products_price,v_products_quantity,pwas_attrib_id,pwas_products_quantity,v_options_name

Please help!

27 Feb 2010, 6:55 PM
#2
hgrubb avatar

hgrubb

New Zenner

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

Re: Easy Popluate and Stocks By Attribute Error

Line 803

while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){
4 Mar 2010, 2:58 AM
#3
hgrubb avatar

hgrubb

New Zenner

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

Re: Easy Popluate and Stocks By Attribute Error

Anyone?

21 Sep 2010, 5:05 AM
#4
redheads avatar

redheads

Zen Follower

Join Date:
May 2006
Posts:
119
Plugin Contributions:
0

Re: Easy Popluate and Stocks By Attribute Error

Still no ideas, or did someone figure this out and forget to post about it ;-)

??

I have been reading and searching... I have the same error, same experience as the others here - EP works, Stock by attributes works, EP w/ stock by attributes... error. I did not get the 'header errors' - just this is in my csv file:

<br /> <b>Warning</b>: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in <b>/home/xxxxxx/...admin/easypopulate.php</b> on line <b>803</b><br /> v_products_model v_specials_price v_specials_date_avail v_specials_expires_date v_products_price v_products_quantity pwas_attrib_id pwas_products_quantity v_options_name

Only on that one download option (the one added by EP w/stock by attributes)

21 Sep 2010, 6:45 AM
#5
redheads avatar

redheads

Zen Follower

Join Date:
May 2006
Posts:
119
Plugin Contributions:
0

Re: Easy Popluate and Stocks By Attribute Error

Ok, in the error log I find this:

MySQL error 1146: Table 'XXXXX.products_with_attributes_stock' doesn't exist
When executing:
SELECT
			p.products_id as v_products_id,
			p.products_model as v_products_model,
			p.products_price as v_products_price,
			p.products_tax_class_id as v_tax_class_id,
			p.products_quantity as v_products_quantity,
			pa.products_attributes_id as pwas_attrib_id,
			pwas.quantity as pwas_products_quantity,
			pov.products_options_values_name as v_options_name
			FROM
			XXXX_products as p
			JOIN
			XXXX_products_attributes as pa
            on  p.products_id = pa.products_id
            JOIN
            aami_products_options_values as pov
            on      pa.options_values_id = pov.products_options_values_id
            join    products_with_attributes_stock PWAS
            on      PWAS.stock_attributes = pa.products_attributes_id

and the table prefix is NOT listed correctly - it should have the database name and the PREFIX on it... like:

XXXXX.<prefix>_products_with_attributes_stock

a hint as to the problem??? mayhaps??? Maybe it is not going to find the table it is looking for, since there is no prefix??

And if that is the problem, how to fix it???

I tried the same install on another shop, same error. Shop is 1.3.8p3

18 Jan 2011, 11:09 PM
#6
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,798
Plugin Contributions:
22

Re: Easy Popluate and Stocks By Attribute Error

Hey guys, did anyone solve this issue?
I believe i found a solution, but would like to hear from someone who's having this issue to verify.

8 Jun 2011, 7:58 PM
#7
manage_it avatar

manage_it

Inactive

Join Date:
May 2006
Posts:
80
Plugin Contributions:
0

Re: Easy Popluate and Stocks By Attribute Error

I have the same issue. What is the solution? Then I can test it.
thx.

8 Jun 2011, 9:50 PM
#8
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,798
Plugin Contributions:
22

Re: Easy Popluate and Stocks By Attribute Error

manage-it:

I have the same issue. What is the solution? Then I can test it.
thx.

Naaaah, I was totally wrong, the solution I found actually didn't work. I kept getting errors and eventually gave up on the idea...

I do remember there was something to do with the table's prefix that was causing problems, you might start there.

Sorry I don't know more...

25 Sep 2012, 9:08 PM
#9
christamcc avatar

christamcc

New Zenner

Join Date:
May 2008
Posts:
21
Plugin Contributions:
0

Re: Easy Popluate and Stocks By Attribute Error

In case anyone is still using this plug in and experiencing the problem. (This was for Easy Populate version 1-2-5-7 but may also apply to early versions, I'm not sure.)
Try this...

In the easypopulate.php file in the admin change line 137:
from:

if(strlen(EASYPOPULATE_CONFIG_CUSTOM_FIELDS) > 0)

to this:

 if(defined("EASYPOPULATE_CONFIG_CUSTOM_FIELDS") && (strlen(EASYPOPULATE_CONFIG_CUSTOM_FIELDS) > 0))

or if you just want to comment out the existing line so that it will still be in the file but will be ignored then do this:

//if(strlen(EASYPOPULATE_CONFIG_CUSTOM_FIELDS) > 0)
if(defined("EASYPOPULATE_CONFIG_CUSTOM_FIELDS") && (strlen(EASYPOPULATE_CONFIG_CUSTOM_FIELDS) > 0))

(The reason: It looks like that constant variable EASYPOPULATE_CONFIG_CUSTOM_FIELDS isn't defined if you weren't using custom fields, but there is a logical test being applied to it. So first check that it is defined and if it is then check to see if it has a value.)

I also noticed on line 544;

$custom_layout_sql = '  ';

that most likely should be:

$custom_filelayout_sql = '  ';

(The reason: $custom_layout_sql is not used anywhere else, and fix $custom_filelayout_sql is only being set in the code if certain conditions apply, but is always present in the query even if the conditions don't apply therefore should be assigned the empty string in case the condition does not apply.)

Those should fix the Complete.csv download (it did for me!), and possibly more. I applied this solution as soon as I got the first error on the Copmpete.csv download, so I'm not sure how many other errors it may have fixed.

Good luck!

26 Sep 2012, 8:03 AM
#10
christamcc avatar

christamcc

New Zenner

Join Date:
May 2008
Posts:
21
Plugin Contributions:
0

Re: Easy Popluate and Stocks By Attribute Error

Oh, and if you are using the Stock By Attribute version of the easypopulate.php then about line 549 you'll need to change:

join    products_with_attributes_stock PWAS
on      PWAS.stock_attributes = pa.products_attributes_id

to

JOIN products_with_attributes_stock pwas
on      pwas.stock_attributes = pa.products_attributes_id

(The reason: in that query, one of the select fields is pwas.quantity, but the table *pwas * didn't exist, just PWAS. As you may have deduced by reading this, you could have alterantively kept the lines above the same and instead changed pwas.quantity as pwas_products_quantity, to PWAS.quantity as pwas_products_quantity,. Either option should word, but I did not test the alternative one.)

Note - Changing *join *to JOIN didn't fix anything, that was just to add consistency to the style of the query.