Results 1 to 10 of 19

Hybrid View

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

    Default Problem or not? Incorrect integer value for column customer_notified

    Hello chaps

    I'm trying to figure out if the following error in the debug log is a fault that I need to fix, or if I can ignore it.

    [12-Mar-2015 14:11:06 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 ('4286', '1', now(), 'PayPal status: Refunded @ 21:17:30 Mar 09, 2015 PDT Parent Trans ID:xxxxxxxxxxxxxx Trans ID:xxxxxxxxxxxxxx Amount: -161.75 AUD', '')
    in C:\inetpub\wwwroot\xxxxxxxxxxxxxx\includes\classes\db\mysql\query_factory.php on line 120



    It looks like it doesn't like the value to be empty, but I'm no PHP/MySQL expert so I don't really know.

    I can't see any issues in the store admin. I only noticed this one in the logs. It appears to be a PayPal refund. Is this likely to be a problem or can I safely ignore it?

    Thanks for any advice on this.
    Rob

    These are the details of my website:

    Zen Cart 1.5.1
    Database Patch Level: 1.5.1
    v1.5.1 [2013-10-25 16:43:45] (Version Update 1.5.0->1.5.1)
    v1.5.0 [2013-10-25 16:43:45] (Version Update 1.3.9->1.5.0)
    v1.3.9b [2010-05-18 18:34:34] (Version Update 1.3.8->1.3.9b)
    v1.3.8 [2008-07-30 02:07:56] (Fresh Installation)

    It uses the PayPal Express checkout and has some unrelated plugins such as the one for image resizing and OZPost for shipping.

    Other info that may or may not matter:
    Server Host: xxxxxxxx Database Host: 127.0.0.1 (127.0.0.1)
    Server OS: Windows NT SV8774 6.2 build 9200 (Unknow Windows version Standard Edition) i586 Database: MySQL 5.5.42
    HTTP Server: Microsoft-IIS/8.5
    PHP Version: 5.3.28 (Zend: 2.3.0) PHP Memory Limit: 128M PHP Safe Mode: Off
    PHP File Uploads: On Max Size: 2M POST Max Size: 8M
    Database Data Size: 73,089 kB Database Index Size: 3,227 kB

  2. #2
    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
    I'm trying to figure out if the following error in the debug log is a fault that I need to fix, or if I can ignore it.
    This one shouldn't be ignored because it means you'll be losing some valuable information from your orders history.

    Do you want the good news or the bad news first?

    OK, the good news. This problem isn't unique to you. I've experienced (and fixed) the exact same issue.

    The bad news. I can't find or recall exactly what I did to fix it. I've searched my code to see if I can see any changes I made for this, but didn't find anything (it may be one of those rare times I forgot to leave myself any comments in the code), but on the other hand, I think I may have fixed it by modifying the orders_status_history table structure so that it allows NULLS.

    I have verified that this is indeed how my database is configured, but I don't know if that is/was the default setting, or the setting I ended up changing.

    Hopefully someone else that has come across this issue has a more definitive answer.

    Cheers
    RodG

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

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

    Hi Rod

    Yes, that makes good sense.

    I've checked that table here in MySQL Workbench and can see the information in the screenshot for the column.

    Strangely it says 'Yes' in the Nullable column. Do you recall if yours looks like this?



    Regards
    Rob

  4. #4
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,532
    Plugin Contributions
    127

    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.

  5. #5
    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

  6. #6
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,532
    Plugin Contributions
    127

    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.

  7. #7
    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
    I've checked that table here in MySQL Workbench and can see the information in the screenshot for the column.
    Strangely it says 'Yes' in the Nullable column. Do you recall if yours looks like this?
    Yes, that is identical to mine. (So much for that idea).

    I've also checked to see if my fix was the same as that mentioned by swguy (which seems to ring a bell, and even looks like it would be the same kind of fix I'd apply myself), but I've done another search of my code and can't find anything along those lines either.

    It was my intent to identify a similar change in my own code so that I could tell you exactly which file & place you need to add this fix. Alas, I can't even do that. :-(

    Cheers
    RodG

 

 

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