I'm modifying the event calendar on SS 3.1.3 and adding a ticket field to the events, so
NewCalendar extends Calendar which extends Page
NewCalendar $has_many NewEvent
NewEvent extends CalendarEvent which extends Page
NewEvent has a Cost and $has_many NewEventDateTime
NewEventDateTime extends CalendarDateTime which extends DataObject
NewEventDateTime has a TicketsAvailable and $has_one NewEvent
I can view each of the page types in the backend CMS and they show in the Site tree, and if I type the urls of the NewEvents directly they show on the front end, however the NewEvents aren't showing in the NewCalendar's "Jump to Month' widget
In the DB it looks like the ParentIDs are missing for the instances of my New Extensions, so the parent CalendarDateTime doesn't link to the corresponding parent CalendarEvent although the records are there.
How do I explicitly join them?
I assume it's something like this, but it doesn't look to work (and I'm not getting any error messages from it)
public function getCMSFields() {
.....
if(!$this->ParentID) {
$fields->push(new HiddenField("ParentID", "ParentID", Controller::curr()->CurrentPageID()));
}
return $fields;
}
thanks