Results 1 to 10 of 10
  1. #1
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    521
    Plugin Contributions
    3

    Default Banner Manager blank dates causes MySQL Error

    Using ZenCart v1.3.9e on Windows Server with MySQL 5.1.44-community server.

    While using the ACP Banner Manager, when I enter a blank expiry date and blank expiry impressions number, I'm being given the following:

    1292 Incorrect datetime value: 'null'
    in:
    [UPDATE zen_banners SET date_scheduled = '20100801', expires_date = DATE_ADD('null', INTERVAL '23:59:59' HOUR_SECOND), expires_impressions = null WHERE banners_id = 9]
    If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

    The only suggestion that I have is to remove any 'NULL' or 'null' values and simply assign a value of '' instead. MySQL will automatically note that the 0 length string is NULL and assign it as such. The same holds true if ALL schedule values is blank.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Banner Manager blank dates causes MySQL Error

    That's peculiar.
    I'm using the same version of MySQL, and can't recreate that problem.
    If I leave expiry date and impressions blank, it correctly blanks them out, without throwing any errors.
    .

    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.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Banner Manager blank dates causes MySQL Error

    In fact, embracing null was done with specific intent, akin to this prior bug report: http://www.zen-cart.com/forum/showthread.php?t=69347
    .

    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.

  4. #4
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    521
    Plugin Contributions
    3

    Default Re: Banner Manager blank dates causes MySQL Error

    Quote Originally Posted by DrByte View Post
    That's peculiar.
    I'm using the same version of MySQL, and can't recreate that problem.
    If I leave expiry date and impressions blank, it correctly blanks them out, without throwing any errors.
    I left both expiry date and impressions blank and I get this messages:

    1292 Incorrect datetime value: 'null' for column 'date_scheduled' at row 1
    in:
    [UPDATE zen_banners SET date_scheduled = 'null', expires_date = DATE_ADD('null', INTERVAL '23:59:59' HOUR_SECOND), expires_impressions = null WHERE banners_id = 9]
    If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

    This was while I was running admin/banner_manager.php?page=1&action=update

    Any suggestions?

  5. #5
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Banner Manager blank dates causes MySQL Error

    What's the schema for your zen_banners table?
    .

    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. #6
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    521
    Plugin Contributions
    3

    Default Re: Banner Manager blank dates causes MySQL Error

    I figured it out DrByte.

    My Database, MySQL 5.1.44, was running in STRICT MODE. Which in turn, prevents the insertion of NULL Variables into the database. After shutting down and restarting, making sure to disable the strict mode, I managed to get to work.

  7. #7
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Re: Banner Manager blank dates causes MySQL Error

    I've just ran into this issue too (as I'm running MySQL in strict mode).

    Is there any way to fix this (other than turning off strict mode)?

  8. #8
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Banner Manager blank dates causes MySQL Error

    Not without rewriting a bunch of code.
    .

    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.

  9. #9
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Re: Banner Manager blank dates causes MySQL Error

    Thanks for the update DrByte.

    Will this be treated as a bug, or is it the view of the Dev. Team that ZC compatibility with MySQL strict mode doesn't matter?

    Always good to hear different people's opinions. :)

    All the best,

    Alex

  10. #10
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    521
    Plugin Contributions
    3

    Default Re: Banner Manager blank dates causes MySQL Error

    Quote Originally Posted by Alex Clarke View Post
    Thanks for the update DrByte.

    Will this be treated as a bug, or is it the view of the Dev. Team that ZC compatibility with MySQL strict mode doesn't matter?

    Always good to hear different people's opinions. :)

    All the best,

    Alex
    Most servers, at least those I encountered, aren't really run in Strict Mode. I only had it turned on because as I was installing MySQL, I checked the box being an idiot not realizing what I was doing.

 

 

Similar Threads

  1. v139h Banner Manager's Start and Stop Dates Not Showing
    By CSPEN in forum General Questions
    Replies: 20
    Last Post: 3 May 2012, 04:11 AM
  2. Poll Manager error (mysql)
    By gcampos in forum All Other Contributions/Addons
    Replies: 9
    Last Post: 23 Jan 2008, 09:02 AM
  3. Replies: 3
    Last Post: 20 Nov 2007, 10:45 PM
  4. Banner Manager Dates
    By t.harrison in forum Basic Configuration
    Replies: 1
    Last Post: 8 Jun 2007, 05:13 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR