You are not logged in.
Today I wanted to display an article in the future, but instead of altering the publication time, i altered the publication date. i inserted into the field for the month the value “18” which is not valid.
textpattern didn’t show a message, as i would expect. instead, the publication date was changed to 1970-01-01 which is really not the behaviour i expect.
could there an error message inserted?
Offline
I don’t know for certain, but yes, I think there’s no error checking done there, and there should be.
The question is how to handle it properly. I’m thinking force dates into the correct structure (so 18 becomes 12, etc), but give you a warning (like we warn about duplicate url titles, for instance).
My email address has changed recently. If you need to contact me, use the forum contact form.
Offline
Unless you’re referring to some kind of JavaScript early warning, which I can see, that wouldn’t be a good idea: the result would be completely losing all your changes. That’d be the quickest way to send most people into orbit. ;p
My email address has changed recently. If you need to contact me, use the forum contact form.
Offline
well, for that, i’m not deep enough in the code.
i just thought:
when user clicks “save”
1. check if entered date is valid
2. if date is not valid, use the value, which was stored in the db.
problem: if user changes date to invalid value before 1st save. then you could use the current date.
or you can go for:
if entered date is not valid, use current date
in both cases the user should get a error message.
Offline
Hmm… if you don’t mind letting MySQL do the error checking, you can do this:
Last edited by ruud (2006-12-13 17:50:18)
Offline
The-Exit wrote:
well, for that, i’m not deep enough in the code.
i just thought:
when user clicks “save”
1. check if entered date is valid
2. if date is not valid, use the value, which was stored in the db.problem: if user changes date to invalid value before 1st save. then you could use the current date.
or you can go for:
if entered date is not valid, use current datein both cases the user should get a error message.
I agree with those suggestions. By default, the input fields for article expiry date is empty, when new article is created. When I edit the article and click “Save”, SQL error message appeared on top of the page!
The error start with the following string:
Incorrect datetime value: '0' for column 'Expires' at row 1 update txp_textpattern set Title = ...
Offline
hongster, can you open a new topic for this specific error and include exact steps to reproduce. This appears to be something that is dependent on MySQL version and may be a bug in TXP.
This topic is quite old and deals with a problem that’s not related to the error message you’re getting.
Offline