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.
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.
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
Re: Banner Manager blank dates causes MySQL Error
Quote:
Originally Posted by
DrByte
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?
Re: Banner Manager blank dates causes MySQL Error
What's the schema for your zen_banners table?
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.
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)?
Re: Banner Manager blank dates causes MySQL Error
Not without rewriting a bunch of code.
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
Re: Banner Manager blank dates causes MySQL Error
Quote:
Originally Posted by
Alex Clarke
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.