Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Upgrading SilverStripe /

Ask questions about upgrading SilverStripe to the latest version.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Upgrading to 2.4: Validation error on DateField


Go to End


2 Posts   2785 Views

Avatar
Mischa

Community Member, 5 Posts

10 May 2010 at 6:57pm

Hi Everyone

I've upgraded to 2.4.0 and got a validation error on DateField types (screenshot attached).

Code:

static $db = array(
...
'Attention' => "Enum('Normal,High', 'Normal')",
'StartDate' => 'Date',
'EndDate' => 'Date',
'PPPNr' => 'Text',
...
);

function getCMSFields() {
$fields = parent::getCMSFields();
$dateField = new DateField('StartDate', 'Start date');
$dateField->setConfig('showcalendar', true);
$fields->addFieldToTab('Root.Content.ProjectData', $dateField);
...

The values in the input fields were placed by the date selection tool. Only values in the Format "May, 5 2010" are working. JavaScript request was 200 OK:
...
validationError('EndDate', 'Please enter a valid time format.', 'validation');
StatusMessage('Validation failed', 'bad');Behaviour.addLoader(hideLoading);
...

Does anybody has a solution?

Thanks for your help.

Attached Files
Avatar
Mischa

Community Member, 5 Posts

10 May 2010 at 7:02pm