Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

error if notify button is not checked


Guest

Recommended Posts

Hi,

after receiving confirmation that my basket is "successfully processed", you have in the same page availability to make the notify button checked or not.

If I check it and click the "continue" button, I will be formwarded to the main page (index.php)

If I don't, I receive this error message:

 

1366 - Incorrect integer value: '' for column 'products_id' at row 1

 

insert into products_notifications (products_id, customers_id, date_added) values ('', '2', now())

 

[TEP STOP]

 

Strange isn't it?

 

Many thanks by advance for any way to solve this issue

 

Frederic

Link to comment
Share on other sites

Did you make any changes to your checkout_success.php?

 

It looks like that action=notify is set even if it is not checked. Maybe an error in the top rows of the checkout_success.php where the redirection to the index page is done or something is wrong within your application_top.php...

Link to comment
Share on other sites

Many thanks by advance for any way to solve this issue

Just add a check to the empty value (application_top.php around line 428):

								if (!is_array($notify)) $notify = array($notify);
							for ($i=0, $n=sizeof($notify); $i<$n; $i++) {
							  if ((int)$notify[$i] > 0) {
							  $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $notify[$i] . "' and customers_id = '" . $customer_id . "'");
							  $check = tep_db_fetch_array($check_query);
							  if ($check['count'] < 1) {
								tep_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . $notify[$i] . "', '" . $customer_id . "', now())");
							  }
							  } // end ((int)$notify[$i] > 0)
							}
							tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));

Have seen it happen before. Had something to do with tep_not_null not recognizing an array as empty when it contained one value, which happened to be null.

Link to comment
Share on other sites

HI,

And thanks for your answer

but it doesn't help me.

 

Is it a missing parameters on the code?

 

I'm not usual with php but have good knowledge on vb environnement

I understand that if the case is not checked, there's a variable with a wrong argument.

But what can I change to resolve this?

 

many thanks by advance,

 

Frederic

Link to comment
Share on other sites

Hi,

No, I didn't change anythings.

To be very shure, I have reinstalled everythings from scratch but the same problem appear.

If I let the "notify" case unchecked, the error message is back again and if I check it, I am redirected to index.php page.

 

...

 

Thanks for your assistance

 

Frederic

Link to comment
Share on other sites

I have similar problem. It is suggested on an other forum that this is related to mysql5. The solution suggested is:

 

Remove strict modes from MySQL.

 

sql-mode= " STRICT_TRANS_TABLES, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION "

 

changed in

 

sql-mode= " NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION "

 

But I dont know how to do this. Any help

 

Sohail

Link to comment
Share on other sites

I have just solved this issue. As my previous mail this is related to Mysql5. This can be solved by amending the file :

 

Program Files/MySQL/MySQL Server 5.0/my.ini

 

from

 

sql-mode= " STRICT_TRANS_TABLES, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION "

 

To

 

sql-mode= " NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION "

 

Following that Mysql must be restarted to make the changes effective.

Hope this will help.

 

Cheers

Link to comment
Share on other sites

No, I didn't change anythings.

To be very shure, I have reinstalled everythings from scratch but the same problem appear.

If I let the "notify" case unchecked, the error message is back again and if I check it, I am redirected to index.php page.

Then IMO you must have made a mistake in adding those two lines. I checked it now (buying one product) and that code works fine for preventing this error (actually I use MySQL5 and it inserted a products_id 0 so this is a bug in osC).

 

Actually last Thursday (August 23 2007) somebody else (H.H.) filed a bug report with another solution for this.

Link to comment
Share on other sites

Hello,

 

This issue seems to work well. Many thanks. :rolleyes:

How to be sure that this bug will be solved in the future update?

:blink:

 

Best regards,

 

Frederic

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...