Date field badly encoded produces error 500

More
12 years 1 month ago #29611 by grabit
Hi,

I had twice the problem last days. The people encoding the new website we are launching made mistake during the date entry.

Instead of using the calendar or entering the date as "2009-10-01" they entered "1 october 2009" then they saved the item and now I had to go manually in the DB to correct this because there was no way to re-edit the item we had an error 500 because of the bad date format. Both in front and back-end.

Is there a way to validate the date before saving? That would be useful because the server is validating it before the output but that is too late!.

My version is J 2.5.7 FC 2.0 RC9 r1514

An Apple a days keeps the doctor away

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #29622 by ggppdk
1 October 2009 , should be parsed and store properly

but an invalid date e.g
1 octber 2009
ddddaaadd

will cause the 500 error

i am fixing this, there will not be error 500 even if an invalid value is loaded from the DB,

also we can add js validation to force user enter date in the preconfigured format


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #29633 by ggppdk
An exception is thrown when we attempt to display a date that is invalid:

i have added check for this in r1520, also when item form is loaded a warning will appear that a value of the particular date field was ignored (if you want it now):

flexicontent.googlecode.com/svn-history/r1520/trunk/com_flexicontent_v2.x/plugins/date/date.php

flexicontent.googlecode.com/svn-history/r1520/trunk/com_flexicontent_v2.x/plugins/date/date.xml

flexicontent.googlecode.com/svn- ... s_date.ini


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #29640 by grabit
Thank you GGPPDK,

I just tested and now no more error 500. Perfect.

There was no mistyping but in fact the back-end is in english and the encoding is in french or dutch.

So "10 avril 2002" is not understand as "2002-04-10".

An Apple a days keeps the doctor away

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.368 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline