Results 1 to 10 of 19

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,515
    Plugin Contributions
    126

    Default Re: Problem or not? Incorrect integer value for column customer_notified

    Right before the insert, do something like this:

    Code:
    if ($customer_notified === '') { 
       $customer_notified = -1;
    }
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  2. #2
    Join Date
    Mar 2006
    Posts
    191
    Plugin Contributions
    0

    Default Re: Problem or not? Incorrect integer value for column customer_notified

    Quote Originally Posted by swguy View Post
    Right before the insert, do something like this:

    Code:
    if ($customer_notified === '') { 
       $customer_notified = -1;
    }

    Thanks for this SWGuy

    I've taken a wild guess after searching via the developer tools at where to put this and have inserted it in:
    \admin\orders.php at line 175

    That makes it look like this:


    Code:
      
    
    		  if ($customer_notified === '') { 
    		  $customer_notified = -1;
    		  }
    
              $db->Execute("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
                          (orders_id, orders_status_id, date_added, customer_notified, comments)
                          values ('" . (int)$oID . "',
                          '" . zen_db_input($status) . "',
                          now(),
                          '" . zen_db_input($customer_notified) . "',
                          '" . zen_db_input($comments)  . "')");
              $order_updated = true;
            }

    Does that look about right?

    Thanks for a look!
    Regards
    Rob

  3. #3
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,515
    Plugin Contributions
    126

    Default Re: Problem or not? Incorrect integer value for column customer_notified

    You betcha! Give it a whirl!

    (My guess wrt the root cause of this issue would be a failed merge of a mod to the admin/orders.php file - this doesn't happen in a new download. But this workaround should suffice for now.)
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  4. #4
    Join Date
    Mar 2006
    Posts
    191
    Plugin Contributions
    0

    Default Re: Problem or not? Incorrect integer value for column customer_notified

    Excellent.. I'll make a note to watch this file on the next upgrade.
    Thanks heaps for this!

    And thanks for your comments too Rod.
    Rob

  5. #5
    Join Date
    Mar 2006
    Posts
    191
    Plugin Contributions
    0

    Default Re: Problem or not? Incorrect integer value for column customer_notified

    hmm poop

    I'm still seeing this error in the logs. It seems to be related to PayPal refunds.

    [20-Mar-2015 12:33:42 Australia/Sydney] PHP Fatal error: 1366:Incorrect integer value: '' for column 'customer_notified' at row 1 :: INSERT INTO orders_status_history (orders_id, orders_status_id, date_added, comments, customer_notified) VALUES ('4125', '1', now(), 'PayPal status: Refunded @ 18:32:39 Mar 19, 2015 PDT
    Parent Trans ID:xxxxxxxxxxxxxxxx
    Trans ID:xxxxxxxxxxxxxxxxxxxx
    Amount: -9.25 AUD', '') in C:\...............\includes\classes\db\mysql\query_factory.php on line 120


    It looks like the error is recorded a number of times in a day and then it stops. Like it's on a schedule.

    In fact, I can see rows on the PayPal IPN tab within Zen Cart that correspond to the errors.

    It looks like there are about 16 entries for each refund. I would guess that PayPal limits the number of times it sends these.

    It does look like the refunds work at PayPal, but are not recorded in the cart because I can't see any notes on the order saying so.

    This store has been running for several years and the owner (my sister) has never said anything is wrong, but she might not know, and if the refunds are going back to the customer then that's fine.


    So this time I downloaded a fresh ZC 1.5.1 zip and compared the file system. Everything appears to be intact, with only the OZPost module and various language changes showing up in WinMerge.

    It is the case that my db is upgraded from as early as ZC 1.3.8.

    So.. could this be something to do with upgrades over time, or possibly a PayPal configuration issue? I'm assuming that if it records the error as above, then it must be coming back to the right place from PayPal.. otherwise it'd record nothing at all.

    Any idea are appreciated.
    Regards
    Rob

  6. #6
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Problem or not? Incorrect integer value for column customer_notified

    Quote Originally Posted by robax View Post
    hmm poop
    I'm still seeing this error in the logs. It seems to be related to PayPal refunds.
    That 'fix' that swguy gave... You'll need to apply the same fix to other parts of the code that contain the
    Code:
    $db->Execute("insert into " . TABLE_ORDERS_STATUS_HISTORY
    code call.

    Quote Originally Posted by robax View Post
    It looks like the error is recorded a number of times in a day and then it stops. Like it's on a schedule.
    Just to be perfectly clear here, are you saying that these events DO NOT coincide with you (the store admin) submitting a PayPal Refund request?

    Quote Originally Posted by robax View Post
    It looks like there are about 16 entries for each refund. I would guess that PayPal limits the number of times it sends these.

    It does look like the refunds work at PayPal, but are not recorded in the cart because I can't see any notes on the order saying so.
    If you don't know anything about trying to provide PayPal refunds, this is starting to now look like you are seeing a possible hack/exploit attempt.

    Quote Originally Posted by robax View Post
    This store has been running for several years and the owner (my sister) has never said anything is wrong, but she might not know, and if the refunds are going back to the customer then that's fine.
    But if those refunds shouldn't be going to *any* customer, then that's not fine.

    Quote Originally Posted by robax View Post
    So this time I downloaded a fresh ZC 1.5.1 zip and compared the file system. Everything appears to be intact, with only the OZPost module and various language changes showing up in WinMerge.
    This will be the case if the V1.5.1 code has this bug/problem (which may or may not be fixed in V1.5.4)

    Quote Originally Posted by robax View Post
    It is the case that my db is upgraded from as early as ZC 1.3.8.

    So.. could this be something to do with upgrades over time,
    No.

    Quote Originally Posted by robax View Post
    or possibly a PayPal configuration issue?
    No.

    Quote Originally Posted by robax View Post
    I'm assuming that if it records the error as above, then it must be coming back to the right place from PayPal.. otherwise it'd record nothing at all.
    I had initially assumed that the events being logged would coincide with PP refunds being given, but based on these latest comments I'm assuming that this is probably some kind of exploit attempt, and for me, that changes things a lot. So much so that it is theoretically possible you may not even want to fix this bug on the basis that the fix may turn the failed exploit into a successful one.

    As for the error being triggered and logged, my thoughts are that this is caused with one of the PHP/MySQL updates that have become a lot more restrictive in what rules can be 'broken' with no ill effect (such as the ability to use a NULL where an INT is expected). IOW, developers now need to take a little bit more care about validating user inputs before using them.

    Cheers
    RodG

  7. #7
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Problem or not? Incorrect integer value for column customer_notified

    Quote Originally Posted by RodG View Post
    That 'fix' that swguy gave... You'll need to apply the same fix to other parts of the code that contain the
    Code:
    $db->Execute("insert into " . TABLE_ORDERS_STATUS_HISTORY
    code call.



    Just to be perfectly clear here, are you saying that these events DO NOT coincide with you (the store admin) submitting a PayPal Refund request?



    If you don't know anything about trying to provide PayPal refunds, this is starting to now look like you are seeing a possible hack/exploit attempt.



    But if those refunds shouldn't be going to *any* customer, then that's not fine.



    This will be the case if the V1.5.1 code has this bug/problem (which may or may not be fixed in V1.5.4)



    No.



    No.



    I had initially assumed that the events being logged would coincide with PP refunds being given, but based on these latest comments I'm assuming that this is probably some kind of exploit attempt, and for me, that changes things a lot. So much so that it is theoretically possible you may not even want to fix this bug on the basis that the fix may turn the failed exploit into a successful one.

    As for the error being triggered and logged, my thoughts are that this is caused with one of the PHP/MySQL updates that have become a lot more restrictive in what rules can be 'broken' with no ill effect (such as the ability to use a NULL where an INT is expected). IOW, developers now need to take a little bit more care about validating user inputs before using them.

    Cheers
    RodG
    I was thinking that perhaps the "16" reoccurrences were like ipn updates that were failing and therefore notification of the initial refund was being tried again. But as well, can see the concern that possibly it is an attempted exploit... Maybe a way to filter to allow just one of the notifications to go through (small price or something) by some unique identifier to see the total result?

    Or better yet, try installing lat9s mydebug backtrace plugin... The error messages should provide much more granularity of what section(s) of code are causing the error by identifying where the sql is that is "not correct".
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. Replies: 2
    Last Post: 22 Jun 2013, 03:48 AM
  2. 1366 Incorrect integer value Problems with MySQL 5 strict-mode
    By Max70 in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 13
    Last Post: 10 Dec 2009, 07:11 PM
  3. Replies: 4
    Last Post: 18 Jul 2009, 04:46 PM
  4. Replies: 4
    Last Post: 14 Jan 2009, 11:45 AM
  5. Incorrect integer value
    By garybook in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 14 Sep 2007, 05:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg