virtualgadjo Posted April 15, 2021 Share Posted April 15, 2021 Hi, i'm currently working on a blog for a friend, using comments, everything works fine except that, locally, in debug mode, in the admin after submitting a post, i've got this error FieldtypeComments: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '1618466849' for column 'created' at row 1 pw 3.0.165 on php7.3.21 what's even funnier is that, in the db, the created column is an unsigned int (the value is correct), the timestamp is here and, of course, displaying the comments on the front end works fine too, the date being well formatted as set in my config call ('dateFormat' => 'd/m/Y H:i',) the only explanation i can imagine is something PDO doesn't like for the insert call from a fieldtype created in the mysqli area ? but i'm still wondering where and why as... it works ? as always, any insight, idea or advice would be very welcome ? have a nice day Link to comment Share on other sites More sharing options...
virtualgadjo Posted April 15, 2021 Author Share Posted April 15, 2021 hi again, i thinks i've found out the problem, the quey that inserts the comment uses the date timestamp as a string what upsets pdo as it ends in an int field now, i'm still searching for where this happens ? have a nice day Link to comment Share on other sites More sharing options...
virtualgadjo Posted April 16, 2021 Author Share Posted April 16, 2021 Hi, don't worry, answering myself again and again is not going to be an habit ? just here to say actually the problem is not being in debug mode or not, the error message is in fact a notice, probably due to the fact that created is everywhere else a datetime (a true one) and is somewhere considered as one on insert (still couldn't find where... no mention of datetime in the module file nor in the form file...) even if for comments it's an int... so far, on the production server, notices are not displayed so i'll leave it as it is until i find some time to insert comments in my own way but continuing to use pw fieldset as everything else works like a charm, moderation, displaying and so on just hope there won't be millions of comments else the errors.txt file in the logs folder will take a lot of room ? have a nice day Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now