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.

Upgrading SilverStripe /

Ask questions about upgrading SilverStripe to the latest version.

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

Upgrading to 2.4: Validation error on DateField


Reply


2 Posts   1805 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

Found a workaround here:

http://www.silverstripe.org/general-questions/show/282914#post282914