Date Field set to today after validation failed

Status
Not open for further replies.

VOI

Member
Hi,

in one of my forms the date fields to which the logged in user has no edit rights - since his ACL is not selected in Form View access - show a strange behaviour:

after creating a new form and trying to save it with some required fields not filled in a validation error message appears - as it should - and the read-only date fields are filled with the current date - which is not intended. They should stay unchanged.

There are no javascripts or validations associated with the relevant date fields - and no PHP form plugins updating any form data in the relevant form.

Any ideas why this happens?

Chris
 
Are you running a recent GitHub version? There had been some fixes concerning non-editable date elements.
 
Updated to the last GitHub version this morning. Described behaviour still occurs.
 
I can't see this (simple form, validation on a field element, ajax + nonajax validation).
Do you have anything special: calc, fileupload, date format?
Joomla and browser cache cleared?

Is it only on new forms?
Multiple date elements - which default values? are there hidden ones (with maybe todays default)?
 
There both calc and fileupload elements on the form as well as a group with a date field with the property "default to current date" set to "yes" ("Always return todays date" is set to "no"). The group in which this current date field belongs to is hidden (property "Show group" set to "Yes, but hidden").
However, unpublishing all the elements mentioned above plus all date fields expect the read-only ones and unhidding the group does not help - the read-only date fields still show todays date.
The date format of all date elements is set to %d-%m-%Y
Clearing the browser cache and Joomla cache (using 'Site - Maintainance - Purge Expired Cache' in the Joomla Backend) didnt have any effect.
I checked if the behaviour also occurs with existing forms: it does it the read-only date fields are empty before the validation fails. However, after athat instead of the current date the following kind of date it shown '30-11--1' (today on 2013-06-09). Moreover, when correcting the validation errors by flling in the fields correctly and saving the form, the values '30-11--1' is not saved - in contrast to the new forms, where the shown current date is stored to the database.
Hope all that helps to find the root cause
Thanks for you help.
Chris
 
Just updated from Github. Unfortunately that didn fix the issue - the current day is still showing up in the read-only fields after a validation failed.

Cleared both the browser and Joomla Cache, logged out. No change.

Chris
 
Friendly bump

This is becoming a major problem regarding data quality since the dates (current date, 30-11-1) get stored to the database messing up the records.

I provided the login data to the site backend in my "Personal Details".
 
I've tried to replicate (non-editable date with default=current date, calc element, fileupload element, field with validation) but all is ok, failing validation doesn't change the date.
Are you running a recent GitHub?
 
I updated from Github on June 13th as mentioned above after rob said it should be fixed.

Maybe you can have a look at the site - see my Personal Details.
 
I don't have access to "YourSite" (Rob and Hugh only) and I really don't know the date element code.
But there has been a big date element code change in GitHub today, with this version I couldn't replicate your issue.
So I would suggest to (backup and) update.
 
Updated from Github last night - this fixed the issue. Thanks a lot.

Closing the thread.

Chris
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top