Hi guys,
I'm trying to pick this up again after a long time away. I've got some pretty confusing problems to get started.
static $db = array (
'Venue' => 'text'
)
static $has_one = array(
'Image' => 'Image',
'TheVenue' => 'VenuePage'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new DropdownField(
'Venue',
'Choose a Venue',
Dataobject::get("VenuePage")->map("ID", "Title", "Please Select", "", $this)),
'Content');
/* get venuepage */
$fields->addFieldToTab('Root.Content.Main', new DropdownField(
'TheVenue',
'Choose a Venue',
Dataobject::get("VenuePage")->map("ID", "Title", "Please Select", "", $this)),
'Content');
Venue works
TheVenue seems to break the parent page VenueHolder and I can no longer save any pages in the cms even after removing the changes in the code.
I want to add a has_one relationship of an Event page to a venue page, however doing this breaks the cms and I can no longer publish any of the pages even after I remove the change and ?flush=all
Secondly I want to display the data of the selected Venue but $Venue only displays the table ID how can I get all the data in the row using DataObject get?
These are likely easy fixes but with not alot of experience, documentation and no error output I'm at a complete loss as to how I should start troubleshooting?
any advice is apperciated,
cheers,
dan.