Hi All
I'm not exactly top shelf when it comes to the coding stuff and could use a bit of help with where to look for the error causing my problem.
I have made a minor extension to the CalendarDateTime Class to add three new fields:
New file MeetDetails.php in mysite/code folder:
<?php
class MeetDetails extends DataExtension
{
private static $db = array(
'Location' => 'Text',
'Entries Close' => 'Date',
'No Times' => 'Boolean'
);
private static $has_one = array (
'Event' => 'CalendarEvent'
);
public function updateCMSFields(FieldList $fields) {
$fields->push(new TextField('Location', 'Location'));
$fields->push(new DateField('Entries Close', 'Date Entries Close'));
$fields->push(new CheckboxField('No Times', 'No Times Allowed'));
}
}
and added;
Object::add_extension('CalendarDateTime', 'MeetDetails');
to my _config.php file.
Ran dev/build?flush=1 and new fields appear in database and in CMS as expected.
The problem is only the 'Location" textfield will save any data. With the other two you can set them all you like but they wont save anything.
Pushing the 'Save" button reloads the page but the two fields reset to blank.
Where should I start looking to solve this?
Any help appreciated.