Jump to content

invalid comments datetime ?


virtualgadjo
 Share

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...