0

I'm trying to create a very simple performance class that extends dataobject and has a date for one of the fields but for some reason if I fill it out when I press 'Add' it just hangs. I've checked in the Chrome inspector and it fires off the Ajax request but the request never returns anything, I've even tried leaving it for a few minutes and still nothing returns and nothing gets puts in the error log either. If I leave the date blank and just fill out the text field it works fine, here is the code I'm using.

class Performance extends DataObject {
    static $db = array(
        'Title' => 'Varchar(255)',
        'StartDate' => 'Date',
    );

    static $summary_fields = array(
        'Title' => 'Title',
        'Starts' => 'StartDate',
    );

    static $has_one = array(
        'Production' => 'ProductionPage'
    );  
}

What's really weird is if I grab the ArticlePage class from the extending Silverstripe tutorial it works fine, it's just if I try and do it with a DataObject rather than a page that I run into this.

Would really appreciate any help with this, I've been struggling with it for hours now.

pogo
  • 2,287
  • 2
  • 25
  • 36
  • There's absolutely nothing in the log? Maybe you could also show the code for accessing the two fields in the CMS? – xeraa Aug 13 '11 at 15:54

1 Answers1

0

Try the Legacydatetimefields module: http://www.silverstripe.org/legacydatetimefields-module/

There was a change of how Silverstripe handles date and time in the latest version (2.4) which means some older code dealing with date and time doesn't work.

Hope this helps.

BaronGrivet
  • 4,364
  • 5
  • 37
  • 52